From 929c2cf53a88a6a074b3bdb24dffd082e85b7f4f Mon Sep 17 00:00:00 2001 From: rocketcamel <87954986+rocketcamel@users.noreply.github.com> Date: Sat, 8 Feb 2025 13:44:57 -0800 Subject: [PATCH] feat!(wsl): added common wsl config, add tux-wsl (#2) --- .config/nvim/lazy-lock.json | 2 +- nix/flake.nix | 37 +++++++++++++++++------- nix/hosts/tux-wsl/configuration.nix | 15 ++++++++++ nix/hosts/wsl-kumatani/configuration.nix | 16 ---------- nix/hosts/wsl-usahara/configuration.nix | 12 -------- nix/hosts/wsl/configuration.nix | 25 ++++++++++++++++ 6 files changed, 67 insertions(+), 40 deletions(-) create mode 100644 nix/hosts/tux-wsl/configuration.nix create mode 100644 nix/hosts/wsl/configuration.nix diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index fcf9586..228e3e8 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -2,7 +2,7 @@ "conform.nvim": { "branch": "master", "commit": "363243c03102a531a8203311d4f2ae704c620d9b" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, "harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" }, - "lazy.nvim": { "branch": "main", "commit": "f15a93907ddad3d9139aea465ae18336d87f5ce6" }, + "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "luau-lsp.nvim": { "branch": "main", "commit": "f81c6c713e4598abc484cbeabca918475d176c54" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "f75e877f5266e87523eb5a18fcde2081820d087b" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, diff --git a/nix/flake.nix b/nix/flake.nix index 00b8c9e..b97d302 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -31,6 +31,11 @@ name = "tux"; architecture = "x86_64-linux"; } + { + name = "tux-wsl"; + architecture = "x86_64-linux"; + isWSL = true; + } ]; in { @@ -45,17 +50,27 @@ }; }; system = host.architecture; - modules = [ - ./hosts/${host.name}/configuration.nix - ./modules/default.nix - home-manager.nixosModules.home-manager - { - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - } - ] ++ (if builtins.hasAttr "isWSL" host then [ nixos-wsl.nixosModules.default ] else [ ]); + modules = + [ + ./hosts/${host.name}/configuration.nix + ./modules/default.nix + home-manager.nixosModules.home-manager + { + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + } + ] + ++ ( + if builtins.hasAttr "isWSL" host then + [ + nixos-wsl.nixosModules.default + ./hosts/wsl/configuration.nix + ] + else + [ ] + ); }; }) hosts ); diff --git a/nix/hosts/tux-wsl/configuration.nix b/nix/hosts/tux-wsl/configuration.nix new file mode 100644 index 0000000..6d50be1 --- /dev/null +++ b/nix/hosts/tux-wsl/configuration.nix @@ -0,0 +1,15 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ + config, + lib, + pkgs, + meta, + ... +}: + +{ + system.stateVersion = "25.05"; +} diff --git a/nix/hosts/wsl-kumatani/configuration.nix b/nix/hosts/wsl-kumatani/configuration.nix index 1d2ebd3..24722fc 100644 --- a/nix/hosts/wsl-kumatani/configuration.nix +++ b/nix/hosts/wsl-kumatani/configuration.nix @@ -1,7 +1,3 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page, on -# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). - { config, lib, @@ -11,17 +7,5 @@ }: { - imports = [ ]; - - wsl.enable = true; - wsl.defaultUser = "luca"; - networking.hostName = meta.hostname; - users.users.luca = { - shell = pkgs.zsh; - openssh.authorizedKeys.keys = config.authorized_ssh; - }; - - environment.systemPackages = with pkgs; config.commonPackages ++ [ ]; - system.stateVersion = "24.05"; } diff --git a/nix/hosts/wsl-usahara/configuration.nix b/nix/hosts/wsl-usahara/configuration.nix index 1d2ebd3..43952f7 100644 --- a/nix/hosts/wsl-usahara/configuration.nix +++ b/nix/hosts/wsl-usahara/configuration.nix @@ -11,17 +11,5 @@ }: { - imports = [ ]; - - wsl.enable = true; - wsl.defaultUser = "luca"; - networking.hostName = meta.hostname; - users.users.luca = { - shell = pkgs.zsh; - openssh.authorizedKeys.keys = config.authorized_ssh; - }; - - environment.systemPackages = with pkgs; config.commonPackages ++ [ ]; - system.stateVersion = "24.05"; } diff --git a/nix/hosts/wsl/configuration.nix b/nix/hosts/wsl/configuration.nix new file mode 100644 index 0000000..a9da72f --- /dev/null +++ b/nix/hosts/wsl/configuration.nix @@ -0,0 +1,25 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ + config, + lib, + pkgs, + meta, + ... +}: + +{ + imports = [ ]; + + wsl.enable = true; + wsl.defaultUser = "luca"; + networking.hostName = meta.hostname; + users.users.luca = { + shell = pkgs.zsh; + openssh.authorizedKeys.keys = config.authorized_ssh; + }; + + environment.systemPackages = with pkgs; config.commonPackages ++ [ ]; +}