wsl compatibility fixes

This commit is contained in:
Noah Masur 2022-07-08 01:31:00 +00:00
parent 86b1ab61cb
commit cfe3c137ba
4 changed files with 84 additions and 5 deletions

View File

@ -21,6 +21,37 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1653893745,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -59,6 +90,21 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1654360807,
"narHash": "sha256-wYG86PUkPZ1P/oHsCpepTkb/U26poaEPPp1XFjRsgdA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d9794b04bffb468b886c553557489977ae5f4c65",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-22.05",
"type": "indirect"
}
},
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1656611551, "lastModified": 1656611551,
@ -80,7 +126,8 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nur": "nur", "nur": "nur",
"wallpapers": "wallpapers" "wallpapers": "wallpapers",
"wsl": "wsl"
} }
}, },
"utils": { "utils": {
@ -113,6 +160,26 @@
"repo": "wallpapers", "repo": "wallpapers",
"type": "gitlab" "type": "gitlab"
} }
},
"wsl": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1656703122,
"narHash": "sha256-2Eb5dd7AYlJ359QmRomzlaQQLMep0kT0iVVfMMHE7SQ=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "46bf5e0f86b01faad3498bc4ef3706e5568b4fd6",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NixOS-WSL",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@ -13,6 +13,9 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# Used for Windows Subsystem for Linux compatibility
wsl.url = "github:nix-community/NixOS-WSL";
# Used for user packages # Used for user packages
home-manager = { home-manager = {
url = "github:nix-community/home-manager/master"; url = "github:nix-community/home-manager/master";
@ -31,7 +34,7 @@
}; };
outputs = { self, nixpkgs, darwin, home-manager, nur, wallpapers }: outputs = { self, nixpkgs, darwin, wsl, home-manager, nur, wallpapers }:
let let
@ -60,7 +63,7 @@
desktop = import ./hosts/desktop { desktop = import ./hosts/desktop {
inherit nixpkgs home-manager nur globals wallpapers; inherit nixpkgs home-manager nur globals wallpapers;
}; };
wsl = import ./hosts/wsl { inherit nixpkgs home-manager globals; }; wsl = import ./hosts/wsl { inherit nixpkgs wsl home-manager globals; };
}; };
darwinConfigurations = { darwinConfigurations = {

View File

@ -1,4 +1,4 @@
{ nixpkgs, home-manager, globals, ... }: { nixpkgs, wsl, home-manager, globals, ... }:
# System configuration for WSL # System configuration for WSL
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
@ -7,13 +7,22 @@ nixpkgs.lib.nixosSystem {
modules = [ modules = [
globals globals
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
wsl.nixosModules.wsl
home-manager.nixosModules.home-manager
{ {
networking.hostName = "wsl"; networking.hostName = "wsl";
gui.enable = false; gui.enable = false;
passwordHash = passwordHash =
"$6$PZYiMGmJIIHAepTM$Wx5EqTQ5GApzXx58nvi8azh16pdxrN6Qrv1wunDlzveOgawitWzcIxuj76X9V868fsPi/NOIEO8yVXqwzS9UF."; "$6$PZYiMGmJIIHAepTM$Wx5EqTQ5GApzXx58nvi8azh16pdxrN6Qrv1wunDlzveOgawitWzcIxuj76X9V868fsPi/NOIEO8yVXqwzS9UF.";
wsl = {
enable = true;
automountPath = "/mnt";
defaultUser = globals.user;
startMenuLaunchers = true;
};
} }
../common.nix ../common.nix
../../modules/system
../../modules/programming/nix.nix ../../modules/programming/nix.nix
../../modules/programming/lua.nix ../../modules/programming/lua.nix
]; ];

View File

@ -24,7 +24,7 @@
}; };
accounts.email = { accounts.email = {
maildirBasePath = "$HOME/mail"; maildirBasePath = "${config.homePath}/mail";
accounts = { accounts = {
home = let address = "${config.mailUser}@${config.mailServer}"; home = let address = "${config.mailUser}@${config.mailServer}";
in { in {