add support for WSL
This commit is contained in:
parent
f41ae25fa9
commit
0dc6c4cbf8
27
flake.lock
27
flake.lock
|
@ -106,6 +106,32 @@
|
|||
"url": "https://forgejo.owo.monster/chaos/musicutil"
|
||||
}
|
||||
},
|
||||
"nixos-wsl": {
|
||||
"inputs": {
|
||||
"flake-compat": [
|
||||
"flake-compat"
|
||||
],
|
||||
"flake-utils": [
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs-unstable"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1696883888,
|
||||
"narHash": "sha256-EdQMeJxDoi26YDtkNf20mNBeCj7Y5eKg+rrxkiB86z0=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NixOS-WSL",
|
||||
"rev": "5da7c4fd0ab9693d83cae50de7d9430696f92568",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "NixOS-WSL",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1695644571,
|
||||
|
@ -170,6 +196,7 @@
|
|||
"food-site": "food-site",
|
||||
"home-manager-unstable": "home-manager-unstable",
|
||||
"musicutil": "musicutil",
|
||||
"nixos-wsl": "nixos-wsl",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"nur": "nur",
|
||||
"piped-flake": "piped-flake",
|
||||
|
|
|
@ -16,6 +16,12 @@
|
|||
home-manager-unstable.url = "github:nix-community/home-manager";
|
||||
home-manager-unstable.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
|
||||
nixos-wsl.url = "github:nix-community/NixOS-WSL";
|
||||
nixos-wsl.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
nixos-wsl.inputs.flake-utils.follows = "flake-utils";
|
||||
nixos-wsl.inputs.flake-compat.follows = "flake-compat";
|
||||
|
||||
|
||||
tree-input.url = "github:kittywitch/tree";
|
||||
tree-input.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
{...}: {
|
||||
home.sessionVariables = {
|
||||
DONT_PROMPT_WSL_INSTALL = 1;
|
||||
};
|
||||
programs.vscode-mod = {
|
||||
enable = true;
|
||||
userSettings = {
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
|
||||
inputs.home-manager-unstable.nixosModules.home-manager
|
||||
|
||||
inputs.nixos-wsl.nixosModules.default
|
||||
|
||||
inputs.vaultui.nixosModules.default
|
||||
inputs.piped-flake.nixosModules.default
|
||||
|
||||
|
@ -70,6 +72,16 @@ in {
|
|||
modules = defaultModules ++ [./lappy-t495/lappy-t495.nix ./lappy-t495/hardware.nix];
|
||||
};
|
||||
|
||||
wsl = nixosUnstableSystem {
|
||||
specialArgs =
|
||||
defaultSpecialArgs
|
||||
// {
|
||||
hostPath = ./wsl;
|
||||
};
|
||||
system = "x86_64-linux";
|
||||
modules = defaultModules ++ [./wsl/wsl.nix];
|
||||
};
|
||||
|
||||
hetzner-arm = nixosUnstableSystem {
|
||||
specialArgs =
|
||||
defaultSpecialArgs
|
||||
|
|
25
hosts/wsl/wsl.nix
Normal file
25
hosts/wsl/wsl.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ tree, ... }: {
|
||||
imports = with tree;[
|
||||
users.root
|
||||
users.chaos
|
||||
profiles.sshd
|
||||
|
||||
presets.nixos.wslBase
|
||||
|
||||
profiles.cross.arm64
|
||||
profiles.remoteBuilders
|
||||
];
|
||||
|
||||
home-manager.users.root = {
|
||||
home.stateVersion = "23.05";
|
||||
};
|
||||
|
||||
home-manager.users.chaos = {
|
||||
home.stateVersion = "23.05";
|
||||
};
|
||||
|
||||
networking.hostName = "wsl";
|
||||
time.timeZone = "Europe/London";
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
}
|
43
presets/nixos/wslBase.nix
Normal file
43
presets/nixos/wslBase.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{tree, ...}: {
|
||||
imports = with tree; [
|
||||
profiles.sound.pipewire
|
||||
profiles.gui.base
|
||||
|
||||
profiles.firewallAllow.aria2c
|
||||
profiles.firewallAllow.soulseek
|
||||
profiles.mullvad
|
||||
];
|
||||
|
||||
boot.plymouth.enable = true;
|
||||
|
||||
home-manager.users.chaos = {
|
||||
imports = with tree; [
|
||||
home.base
|
||||
home.dev.all
|
||||
home.homeFolders
|
||||
|
||||
home.programming.editors.vscode
|
||||
home.programming.languages.rust
|
||||
home.programming.languages.nix
|
||||
|
||||
home.gui.base
|
||||
|
||||
home.apps.fileRoller
|
||||
home.apps.mpv
|
||||
|
||||
home.apps.quassel
|
||||
home.apps.toot-cli
|
||||
|
||||
home.apps.mullvad
|
||||
home.apps.aria2
|
||||
home.apps.rclone
|
||||
home.apps.restic
|
||||
];
|
||||
};
|
||||
|
||||
wsl = {
|
||||
enable = true;
|
||||
defaultUser = "chaos";
|
||||
interop.register = true;
|
||||
};
|
||||
}
|
|
@ -15,6 +15,8 @@ in {
|
|||
|
||||
programs.nm-applet.enable = networkManagerEnabled;
|
||||
|
||||
programs.dconf.enable = true;
|
||||
|
||||
fonts = {
|
||||
packages = with pkgs; [comic-sans comic-code];
|
||||
fontconfig = {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
currentHostname = config.networking.hostName;
|
||||
|
||||
usbSSHKeyFile = "/usb/ssh-keys/chaos.priv";
|
||||
normalSSHKeyFile = "/home/chaos/.ssh/id_ed25519";
|
||||
|
||||
sshKeyFile =
|
||||
if
|
||||
|
@ -16,7 +17,7 @@
|
|||
"tablet"
|
||||
]
|
||||
then usbSSHKeyFile
|
||||
else throw "host isn't configured for remote-builders";
|
||||
else if builtins.elem currentHostname ["wsl"] then normalSSHKeyFile else throw "host isn't configured for remote-builders";
|
||||
|
||||
builderDefaults = {
|
||||
sshUser = "root";
|
||||
|
|
Loading…
Reference in a new issue