From 3b5e4489a48734e81c64e0b1008893a284ee5293 Mon Sep 17 00:00:00 2001 From: xunuwu Date: Fri, 4 Jul 2025 06:07:03 +0200 Subject: [PATCH] add conifer host (desktop wsl) --- flake.lock | 78 +++++++++++++++++++++++++++++++------- flake.nix | 8 +++- hosts/conifer/default.nix | 54 ++++++++++++++++++++++++++ hosts/conifer/hardware.nix | 7 ++++ hosts/conifer/home.nix | 51 +++++++++++++++++++++++++ readme.txt | 1 + 6 files changed, 185 insertions(+), 14 deletions(-) create mode 100644 hosts/conifer/default.nix create mode 100644 hosts/conifer/hardware.nix create mode 100644 hosts/conifer/home.nix diff --git a/flake.lock b/flake.lock index c498a23..8437a2d 100644 --- a/flake.lock +++ b/flake.lock @@ -225,6 +225,22 @@ } }, "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_4": { "flake": false, "locked": { "lastModified": 1696426674, @@ -240,7 +256,7 @@ "type": "github" } }, - "flake-compat_4": { + "flake-compat_5": { "locked": { "lastModified": 1747046372, "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", @@ -448,7 +464,7 @@ }, "git-hooks": { "inputs": { - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_4", "gitignore": "gitignore", "nixpkgs": [ "nvim-config", @@ -654,7 +670,7 @@ }, "neovim-nightly-overlay": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "flake-parts": "flake-parts_3", "git-hooks": "git-hooks", "hercules-ci-effects": "hercules-ci-effects", @@ -758,18 +774,37 @@ "type": "github" } }, - "nixpkgs": { + "nixos-wsl": { + "inputs": { + "flake-compat": "flake-compat_2", + "nixpkgs": "nixpkgs" + }, "locked": { - "lastModified": 1750134718, - "narHash": "sha256-v263g4GbxXv87hMXMCpjkIxd/viIF7p3JpJrwgKdNiI=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "9e83b64f727c88a7711a2c463a7b16eedb69a84c", + "lastModified": 1749574455, + "narHash": "sha256-fm2/8KPOYvvIAnNVtjDlTt/My00lIbZQ+LMrfQIWVzs=", + "owner": "nix-community", + "repo": "nixos-wsl", + "rev": "917af390377c573932d84b5e31dd9f2c1b5c0f09", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-unstable", + "owner": "nix-community", + "repo": "nixos-wsl", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1749173751, + "narHash": "sha256-ENY3y3v6S9ZmLDDLI3LUT8MXmfXg/fSt2eA4GCnMVCE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ed29f002b6d6e5e7e32590deb065c34a31dc3e91", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" } @@ -804,6 +839,22 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1750134718, + "narHash": "sha256-v263g4GbxXv87hMXMCpjkIxd/viIF7p3JpJrwgKdNiI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "9e83b64f727c88a7711a2c463a7b16eedb69a84c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nur": { "inputs": { "flake-parts": [ @@ -907,7 +958,8 @@ "nix-gaming": "nix-gaming", "nix-index-database": "nix-index-database", "nix-minecraft": "nix-minecraft", - "nixpkgs": "nixpkgs", + "nixos-wsl": "nixos-wsl", + "nixpkgs": "nixpkgs_2", "nvim-config": "nvim-config", "own-website": "own-website", "roblox-playtime": "roblox-playtime", @@ -965,7 +1017,7 @@ "base16-helix": "base16-helix", "base16-vim": "base16-vim", "firefox-gnome-theme": "firefox-gnome-theme", - "flake-compat": "flake-compat_4", + "flake-compat": "flake-compat_5", "flake-parts": "flake-parts_6", "git-hooks": "git-hooks_2", "gnome-shell": "gnome-shell", diff --git a/flake.nix b/flake.nix index 0baa162..8b14816 100644 --- a/flake.nix +++ b/flake.nix @@ -30,7 +30,11 @@ l.nixosSystem { modules = [ ./hosts/${hostname} - ./secrets/${hostname} + ( + if b.pathExists ./secrets/${hostname} + then ./secrets/${hostname} + else {} + ) inputs.sops-nix.nixosModules.sops ]; specialArgs = { @@ -107,6 +111,8 @@ impermanence.url = "github:nix-community/impermanence"; + nixos-wsl.url = "github:nix-community/nixos-wsl"; + disko.url = "github:nix-community/disko"; disko.inputs.nixpkgs.follows = "nixpkgs"; diff --git a/hosts/conifer/default.nix b/hosts/conifer/default.nix new file mode 100644 index 0000000..8363741 --- /dev/null +++ b/hosts/conifer/default.nix @@ -0,0 +1,54 @@ +{ + lib, + pkgs, + inputs, + systemProfiles, + specialArgs, + ... +}: { + imports = + [ + ./hardware.nix + + inputs.impermanence.nixosModules.impermanence + + { + home-manager = { + backupFileExtension = "hm-backup"; + users.xun.imports = [ + ./home.nix + {home.stateVersion = "25.05";} + ]; + extraSpecialArgs = specialArgs; + }; + } + ] + ++ (with systemProfiles; [ + core.security + core.users + core.locale + core.tools + core.compat + + programs.fish + + nix.nix + nix.gc + + hardware.graphics + hardware.bluetooth + + services.flatpak + services.xdg-portals + + network.avahi + + programs.home-manager + programs.tools + ]); + + environment.persistence."/persist".enable = false; + + networking.hostName = "conifer"; + system.stateVersion = "25.05"; +} diff --git a/hosts/conifer/hardware.nix b/hosts/conifer/hardware.nix new file mode 100644 index 0000000..c5310f2 --- /dev/null +++ b/hosts/conifer/hardware.nix @@ -0,0 +1,7 @@ +{inputs, ...}: { + imports = [inputs.nixos-wsl.nixosModules.default]; + wsl.enable = true; + wsl.defaultUser = "xun"; + + nixpkgs.hostPlatform.system = "x86_64-linux"; +} diff --git a/hosts/conifer/home.nix b/hosts/conifer/home.nix new file mode 100644 index 0000000..1a91433 --- /dev/null +++ b/hosts/conifer/home.nix @@ -0,0 +1,51 @@ +{ + homeProfiles, + lib, + pkgs, + inputs, + ... +}: { + imports = with homeProfiles; [ + cli.fish + + cli.xdg + cli.direnv + cli.tmux + cli.git + cli.github + cli.forgejo + cli.jujutsu + cli.comma + + programs.nvim + + desktop.xdg-portals + + develop.common + develop.docs + + develop.langs.c + develop.langs.nix + ]; + + programs = { + starship.enable = true; + zoxide.enable = true; + lazygit.enable = true; + }; + home.packages = with pkgs; [ + # coding + tokei + devenv + lazyjj + jjui + ]; + + home = { + username = "xun"; + homeDirectory = "/home/xun"; + extraOutputsToInstall = ["doc" "devdoc"]; + }; + + programs.home-manager.enable = true; +} diff --git a/readme.txt b/readme.txt index 75376e2..6482bf0 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,6 @@ config files for my puters nixdesk - main desktop +conifer - main desktop wsl hopper - server rackserv - cheap 2gb racknerd vps