diff --git a/flake.lock b/flake.lock index a815fc2..bb39899 100644 --- a/flake.lock +++ b/flake.lock @@ -1202,6 +1202,22 @@ "type": "github" } }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1648199409, + "narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "64a525ee38886ab9028e6f61790de0832aa3ef03", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1631561581, @@ -1251,6 +1267,21 @@ } }, "flake-utils_3": { + "locked": { + "lastModified": 1649676176, + "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { "locked": { "lastModified": 1644229661, "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", @@ -1282,7 +1313,7 @@ }, "fup": { "inputs": { - "flake-utils": "flake-utils_3" + "flake-utils": "flake-utils_4" }, "locked": { "lastModified": 1647259887, @@ -1494,6 +1525,26 @@ "type": "github" } }, + "nixos-wsl": { + "inputs": { + "flake-compat": "flake-compat_3", + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1650629047, + "narHash": "sha256-IwiKbzXTzodPKMHm5qTizGoMVjipevbliraFmnrdsqU=", + "owner": "nix-community", + "repo": "NixOS-WSL", + "rev": "69783cf56b2ada7e0e8cc8d17907a346e8bd97b7", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NixOS-WSL", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1633971123, @@ -1540,6 +1591,21 @@ "type": "indirect" } }, + "nixpkgs_3": { + "locked": { + "lastModified": 1649944829, + "narHash": "sha256-wjOgLfjCdyoRamMOrVJceeDJk4LvJsQOxBoT3k16/7Q=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2f06b87f64bc06229e05045853e0876666e1b023", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-21.11", + "type": "indirect" + } + }, "poetry2nix": { "inputs": { "flake-utils": [ @@ -1720,6 +1786,7 @@ "nix-minecraft": "nix-minecraft", "nixos": "nixos", "nixos-hardware": "nixos-hardware_2", + "nixos-wsl": "nixos-wsl", "powercord-setup": "powercord-setup", "quick-nix-registry": "quick-nix-registry", "stable": "stable" diff --git a/flake.nix b/flake.nix index 0160f11..9d39c46 100644 --- a/flake.nix +++ b/flake.nix @@ -41,6 +41,8 @@ quick-nix-registry.url = "github:divnix/quick-nix-registry"; + nixos-wsl.url = "github:nix-community/NixOS-WSL"; + # --- Application-Specific Flake Inputs # # --- Powercord powercord-setup.url = "path:/etc/nixos/subflakes/powercord"; @@ -115,6 +117,7 @@ ./secrets # --- Library Modules --- + inputs.nixos-wsl.nixosModules.wsl inputs.impermanence.nixosModules.impermanence inputs.quick-nix-registry.nixosModules.local-registry diff --git a/hosts/Infini-WSL/default.nix b/hosts/Infini-WSL/default.nix new file mode 100644 index 0000000..0190cdf --- /dev/null +++ b/hosts/Infini-WSL/default.nix @@ -0,0 +1,26 @@ +{ suites, profiles, pkgs, lib, ... }: { + imports = lib.lists.flatten [ + (with suites; [ + base + develop + ]) + ]; + + system.stateVersion = "22.05"; + + # I don't use Windows, but when I do, I want NixOS there with me, + wsl = { + enable = true; + automountPath = "/media"; + defaultUser = "infinidoge"; + startMenuLaunchers = true; + }; + + # No host keys -> No decrypted files -> No password files + modules.secrets.enable = false; + + # This host is only used on WSL on a computer with a strong password already, and agenix is wonky with WSL. + # Public hash and duplicate password is good enough + user.hashedPassword = "$6$SDBGTp1hVS7eOs3P$uJwwxOUxrRaMTAPdc349vvSfA7u.4SHtJuXvxxIo4v70WT9KQqmbOOF5qWS9/.okv.HkcBe0CVj5fLaPy9Oew."; + users.users.root.hashedPassword = "$6$SDBGTp1hVS7eOs3P$uJwwxOUxrRaMTAPdc349vvSfA7u.4SHtJuXvxxIo4v70WT9KQqmbOOF5qWS9/.okv.HkcBe0CVj5fLaPy9Oew."; +} diff --git a/modules/modules/boot.nix b/modules/modules/boot.nix index e948a8f..4411bac 100644 --- a/modules/modules/boot.nix +++ b/modules/modules/boot.nix @@ -19,7 +19,7 @@ in { assertions = [ { - assertion = (count (v: v) [ cfg.grub.enable cfg.systemd-boot.enable ]) == 1; + assertion = (count (v: v) [ cfg.grub.enable cfg.systemd-boot.enable config.wsl.enable ]) == 1; message = "Must enable one and only one bootloader"; } ]; diff --git a/secrets/default.nix b/secrets/default.nix index 2bbeadb..0a6e0da 100644 --- a/secrets/default.nix +++ b/secrets/default.nix @@ -7,7 +7,7 @@ let secrets = lib.mapAttrs' (n: v: lib.nameValuePair (lib.removeSuffix ".age" n) { file = toFile n; }) filtered; in { - options.modules.secrets.enable = lib.mkOpt lib.types.bool true; + options.modules.secrets.enable = lib.hlissner.mkOpt lib.types.bool true; config.age.secrets = lib.mkIf config.modules.secrets.enable secrets; }