feat!(wsl): added common wsl config, add tux-wsl (#2)

This commit is contained in:
rocketcamel
2025-02-08 13:44:57 -08:00
committed by GitHub
parent 6277b9971e
commit 929c2cf53a
6 changed files with 67 additions and 40 deletions

View File

@@ -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
);

View File

@@ -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";
}

View File

@@ -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";
}

View File

@@ -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";
}

View File

@@ -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 ++ [ ];
}