mirror of
https://github.com/nickolaj-jepsen/nixos.git
synced 2026-01-22 00:01:58 +01:00
feat: add desktop-wsl host
This commit is contained in:
parent
fac1a09715
commit
4fd2361813
17 changed files with 92 additions and 18 deletions
39
flake.lock
generated
39
flake.lock
generated
|
|
@ -243,6 +243,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat_3": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1765121682,
|
||||
"narHash": "sha256-4VBOP18BFeiPkyhy9o4ssBNQEvfvv1kXkasAYd0+rrA=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "65f23138d8d09a92e30f1e5c87611b23ef451bf3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
|
|
@ -584,6 +600,28 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-wsl": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_3",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1765644731,
|
||||
"narHash": "sha256-dgSPo+NeAwcBeP4Un9GT+SMsOdLAc0DOLP6cFqoMHK8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NixOS-WSL",
|
||||
"rev": "b160ef46075d8ddc73f026909282d47c0eabb836",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "main",
|
||||
"repo": "NixOS-WSL",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1761597516,
|
||||
|
|
@ -805,6 +843,7 @@
|
|||
"nix-vscode-extensions": "nix-vscode-extensions",
|
||||
"nixos-facter-modules": "nixos-facter-modules",
|
||||
"nixos-generators": "nixos-generators",
|
||||
"nixos-wsl": "nixos-wsl",
|
||||
"nixpkgs": "nixpkgs_4",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"nur": "nur",
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@
|
|||
nur.url = "github:nix-community/NUR";
|
||||
nur.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
|
||||
nixos-wsl.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
disko.url = "github:nix-community/disko";
|
||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,5 @@
|
|||
nixos-facter
|
||||
];
|
||||
|
||||
# System state version (use mkForce to override the default)
|
||||
system.stateVersion = lib.mkForce "25.11";
|
||||
system.stateVersion = "25.11";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
inputs.dankMaterialShell.nixosModules.dankMaterialShell
|
||||
inputs.niri.nixosModules.niri
|
||||
inputs.determinate.nixosModules.default
|
||||
inputs.nixos-wsl.nixosModules.default
|
||||
../modules/base
|
||||
../modules/system
|
||||
../modules/programs
|
||||
|
|
@ -47,5 +48,6 @@ in {
|
|||
work = mkSystem {host = ./work;};
|
||||
homelab = mkSystem {host = ./homelab;};
|
||||
bootstrap = mkSystem {host = ./bootstrap;};
|
||||
desktop-wsl = mkSystem {host = ./desktop-wsl;};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
23
hosts/desktop-wsl/default.nix
Normal file
23
hosts/desktop-wsl/default.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
config = rec {
|
||||
fireproof = {
|
||||
hostname = "desktop-wsl";
|
||||
username = "nickolaj";
|
||||
work.enable = true;
|
||||
dev.enable = true;
|
||||
};
|
||||
|
||||
wsl.enable = true;
|
||||
wsl.defaultUser = fireproof.username;
|
||||
|
||||
services.keyd.enable = false;
|
||||
|
||||
system.stateVersion = "25.11";
|
||||
|
||||
# WSL doesn't use a bootloader - disable systemd-boot
|
||||
boot.loader.systemd-boot.enable = false;
|
||||
boot.loader.efi.canTouchEfiVariables = false;
|
||||
};
|
||||
|
||||
imports = [];
|
||||
}
|
||||
21
justfile
21
justfile
|
|
@ -56,7 +56,7 @@ deploy-remote hostname target:
|
|||
|
||||
install -d -m755 "$temp/etc/ssh"
|
||||
|
||||
# Copy ssh key to decrypt agenix secrets
|
||||
# Copy ssh key to decrypt agenix secrets
|
||||
just age -d "./secrets/hosts/{{ hostname }}/id_ed25519.age" > "$temp/etc/ssh/ssh_host_ed25519_key"
|
||||
chmod 600 "$temp/etc/ssh/ssh_host_ed25519_key"
|
||||
|
||||
|
|
@ -141,6 +141,14 @@ new-host hostname username:
|
|||
echo "Setting up folders"
|
||||
mkdir -p "secrets/hosts/{{ hostname }}"
|
||||
mkdir -p "hosts/{{ hostname }}"
|
||||
cat > "hosts/{{ hostname }}/default.nix" <<'EOF'
|
||||
{
|
||||
config.fireproof.hostname = "{{ hostname }}";
|
||||
config.fireproof.username = "{{ username }}";
|
||||
|
||||
imports = [];
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "Generating SSH key for {{ username }}@{{ hostname }}"
|
||||
ssh-keygen -q -t ed25519 -f "$temp/id_ed25519" -C "{{ username }}@{{ hostname }}" -N ""
|
||||
|
|
@ -153,16 +161,7 @@ new-host hostname username:
|
|||
|
||||
# Bold with no newline
|
||||
cat <<EOF
|
||||
{{ BOLD }}{{ hostname }} = mkSystem {
|
||||
hostname = "{{ hostname }}";
|
||||
username = "{{ username }}";
|
||||
modules = [
|
||||
../modules/required.nix
|
||||
../modules/shell.nix
|
||||
../modules/graphical.nix
|
||||
../modules/devenv.nix
|
||||
];
|
||||
};
|
||||
{{ BOLD }}{{ hostname }} = mkSystem {host = ./{{ hostname }};};{{ NORMAL }}
|
||||
EOF
|
||||
|
||||
[doc("Update flake.lock")]
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ in {
|
|||
type = options.home-manager.users.type.nestedTypes.elemType;
|
||||
};
|
||||
};
|
||||
config = {
|
||||
config = rec {
|
||||
home-manager = {
|
||||
useUserPackages = true;
|
||||
useGlobalPkgs = true;
|
||||
|
|
@ -20,7 +20,7 @@ in {
|
|||
home-manager.users.${username} = mkAliasDefinitions options.fireproof.home-manager;
|
||||
|
||||
# set the same version of home-manager as the system
|
||||
fireproof.home-manager.home.stateVersion = "24.11";
|
||||
system.stateVersion = "24.11";
|
||||
system.stateVersion = lib.mkDefault "24.11";
|
||||
fireproof.home-manager.home.stateVersion = system.stateVersion;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
_: {
|
||||
{lib, ...}: {
|
||||
services.keyd = {
|
||||
enable = true;
|
||||
enable = lib.mkDefault true;
|
||||
keyboards.mouse = {
|
||||
ids = [
|
||||
"046d:c051:4ae65a29" # Work mouse
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -0,0 +1,8 @@
|
|||
age-encryption.org/v1
|
||||
-> ssh-ed25519 KDYMLA Oz0T63FEN1gG8qXtRc8pAI+QKkXjHe8TV8DScjEv2iE
|
||||
740EPr3YEaF18bhC3y9LoDKGPwZNp6HJb2zf9HO16UI
|
||||
-> I7i-grease ~3)/@#.
|
||||
zuyfokI
|
||||
--- B9wNC5rAGapMH9BBoyd41a32agPgeUBB2rErqFmehYA
|
||||
mÄê‘*<2A>Ômæåƒ4—B`_}MéW“;ê±5Ñ¿fÙýyúŒ¿5z]ÃßG›/àÉæ@DâØ_F¼¡ïnQ—¶ü"£x"Û¯dàV—l]ðåd —
|
||||
Ǹj´ž‘è‚ÖS‚bÐT;‘Úíú:Ê*-/öS§?šGó)…á
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
secrets/hosts/desktop-wsl/id_ed25519.age
Normal file
BIN
secrets/hosts/desktop-wsl/id_ed25519.age
Normal file
Binary file not shown.
1
secrets/hosts/desktop-wsl/id_ed25519.pub
Normal file
1
secrets/hosts/desktop-wsl/id_ed25519.pub
Normal file
|
|
@ -0,0 +1 @@
|
|||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN9Npj3JT4F8k8Rz4OGkxzqZ1u95UtURBilt2R0F/HHJ nickolaj@desktop-wsl
|
||||
Loading…
Add table
Add a link
Reference in a new issue