From 086873fd91f4f4c9874da18306ed25fe2532a364 Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Thu, 15 Jun 2023 13:54:20 -0400 Subject: [PATCH] Add wsl-bootstrap config This does not contain the home manager setup, since including that in the bootstrap image appears to prevent home-manager from doing any updates --- flake.nix | 30 ++++++++++++++++++++++++++++-- machines/wsl/configuration.nix | 2 -- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index b2ac907..dc13e35 100644 --- a/flake.nix +++ b/flake.nix @@ -182,8 +182,34 @@ wsl = makeNixosSystem { system = "x86_64-linux"; hostName = "wsl"; - extraModules = - [ wsl.nixosModules.wsl ./machines/wsl/configuration.nix ]; + extraModules = [ + wsl.nixosModules.wsl + ./machines/wsl/configuration.nix + ({ ... }: { # Setup home manager + home-manager.users.nathan = import ./machines/wsl/home.nix; + }) + ]; + }; + + wsl-bootstrap = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inputs = inputs; }; + modules = [ + sops-nix.nixosModules.sops + hyprland.nixosModules.default + ./modules/linux/default.nix + ({ pkgs, lib, config, ... }: { + # Configure hostname + networking = { hostName = "wsl"; }; + # Setup sops + # Add default secrets + sops = { age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; }; + nixpkgs.config.allowUnfree = true; + nixpkgs.config.allowUnfreePredicate = (pkg: true); + }) + wsl.nixosModules.wsl + ./machines/wsl/configuration.nix + ]; }; # VMs diff --git a/machines/wsl/configuration.nix b/machines/wsl/configuration.nix index 08b9753..f967596 100644 --- a/machines/wsl/configuration.nix +++ b/machines/wsl/configuration.nix @@ -16,8 +16,6 @@ }; # Configure networking networking = { domain = "mccarty.io"; }; - # Setup home manager - home-manager.users.nathan = import ./home.nix; # Setup WSL wsl = { enable = true;