initial wsl setup

This commit is contained in:
Christoph Hollizeck 2024-08-21 16:53:36 +02:00
parent ccb0d7ccfd
commit 559b376ac0
6 changed files with 185 additions and 9 deletions

View file

@ -28,12 +28,28 @@
}, },
"original": { "original": {
"owner": "edolstra", "owner": "edolstra",
"ref": "v1.0.1",
"repo": "flake-compat", "repo": "flake-compat",
"type": "github" "type": "github"
} }
}, },
"flake-compat_3": { "flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"ref": "v1.0.1",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_4": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1650374568, "lastModified": 1650374568,
@ -49,7 +65,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_4": { "flake-compat_5": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1650374568, "lastModified": 1650374568,
@ -103,7 +119,7 @@
}, },
"flake-utils-plus": { "flake-utils-plus": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_3" "flake-utils": "flake-utils_4"
}, },
"locked": { "locked": {
"lastModified": 1715533576, "lastModified": 1715533576,
@ -122,7 +138,7 @@
}, },
"flake-utils-plus_2": { "flake-utils-plus_2": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_4" "flake-utils": "flake-utils_5"
}, },
"locked": { "locked": {
"lastModified": 1715533576, "lastModified": 1715533576,
@ -158,6 +174,24 @@
} }
}, },
"flake-utils_3": { "flake-utils_3": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_4": {
"locked": { "locked": {
"lastModified": 1644229661, "lastModified": 1644229661,
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
@ -172,9 +206,9 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_4": { "flake-utils_5": {
"inputs": { "inputs": {
"systems": "systems_3" "systems": "systems_4"
}, },
"locked": { "locked": {
"lastModified": 1694529238, "lastModified": 1694529238,
@ -305,6 +339,28 @@
"type": "github" "type": "github"
} }
}, },
"nixos-wsl": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1724065442,
"narHash": "sha256-8ZUoyeO7Q70bLuijVYvToBSkApw9kfc5hMykTGxB64I=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "0bec2bfb8a2d4dd16e5b012982ca95e57d50e6a2",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NixOS-WSL",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1708475490, "lastModified": 1708475490,
@ -415,6 +471,7 @@
"kickstartnvim": "kickstartnvim", "kickstartnvim": "kickstartnvim",
"nix-ld": "nix-ld", "nix-ld": "nix-ld",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"pyfa": "pyfa", "pyfa": "pyfa",
"snowfall-flake": "snowfall-flake", "snowfall-flake": "snowfall-flake",
@ -425,7 +482,7 @@
}, },
"snowfall-flake": { "snowfall-flake": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_3",
"nixpkgs": [ "nixpkgs": [
"unstable" "unstable"
], ],
@ -447,7 +504,7 @@
}, },
"snowfall-lib": { "snowfall-lib": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_4",
"flake-utils-plus": "flake-utils-plus", "flake-utils-plus": "flake-utils-plus",
"nixpkgs": [ "nixpkgs": [
"snowfall-flake", "snowfall-flake",
@ -471,7 +528,7 @@
}, },
"snowfall-lib_2": { "snowfall-lib_2": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_4", "flake-compat": "flake-compat_5",
"flake-utils-plus": "flake-utils-plus_2", "flake-utils-plus": "flake-utils-plus_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
@ -555,6 +612,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"unstable": { "unstable": {
"locked": { "locked": {
"lastModified": 1722813957, "lastModified": 1722813957,

View file

@ -12,6 +12,11 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixos-wsl = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
};
snowfall-lib = { snowfall-lib = {
url = "github:snowfallorg/lib"; url = "github:snowfallorg/lib";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -84,5 +89,9 @@
nix-ld.nixosModules.nix-ld nix-ld.nixosModules.nix-ld
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
]; ];
systems.hosts.wsl.modules = with inputs; [
nixos-wsl.nixosModules.default
];
}; };
} }

View file

@ -0,0 +1,20 @@
{
lib,
pkgs,
config,
osConfig ? { },
format ? "unknown",
...
}:
with lib.wyrdgard;
{
wyrdgard = {
apps = {
kitty = enabled;
};
tools = {
direnv = enabled;
};
};
}

View file

@ -0,0 +1,48 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.submodules.basics-wsl;
in
{
options.wyrdgard.submodules.basics-wsl = with types; {
enable = mkBoolOpt false "Whether or not to enable basic configuration.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
neofetch
fd
tree
ripgrep
fzf
colorls
];
wyrdgard = {
nix = enabled;
tools = {
git = enabled;
};
system.hardware = {
networking = enabled;
};
system = {
fonts = enabled;
locale = enabled;
time = enabled;
xkb = enabled;
};
};
};
}

1
result Symbolic link
View file

@ -0,0 +1 @@
/nix/store/5bn24v1m3gsjr96fj9h2kavaj67lxh5q-nixos-24.05.20240410.1042fd8-x86_64-linux.iso

View file

@ -0,0 +1,26 @@
{
config,
pkgs,
lib,
...
}:
with lib;
with lib.wyrdgard;
{
wsl = {
enable = true;
defaultUser = config.wyrdgard.user.name;
};
environment.systemPackages = with pkgs; [
git
wslu
wsl-open
];
wyrdgard = {
submodules.basics-wsl = enabled;
};
system.stateVersion = "24.11";
}