From d1b3c635c8945c4b85a992854ffe55b54c46294c Mon Sep 17 00:00:00 2001 From: cnst Date: Mon, 24 Jun 2024 20:59:48 +0200 Subject: [PATCH] restructuring5 --- flake.lock | 62 +++++++++------ hosts/cnix/default.nix | 30 +------- hosts/{programs => common}/adb.nix | 0 hosts/common/default.nix | 76 +++++++++++++++++++ hosts/{programs => common}/hyprland.nix | 0 hosts/{programs => common}/neovim.nix | 0 hosts/{programs => common}/zsh.nix | 0 .../nix-ld.nix => extra/nix-ld/default.nix} | 0 .../solaar.nix => extra/solaar/default.nix} | 0 .../steam.nix => extra/steam/default.nix} | 0 hosts/{generic => locale}/cnix.nix | 13 ---- 11 files changed, 120 insertions(+), 61 deletions(-) rename hosts/{programs => common}/adb.nix (100%) create mode 100644 hosts/common/default.nix rename hosts/{programs => common}/hyprland.nix (100%) rename hosts/{programs => common}/neovim.nix (100%) rename hosts/{programs => common}/zsh.nix (100%) rename hosts/{programs/nix-ld.nix => extra/nix-ld/default.nix} (100%) rename hosts/{programs/solaar.nix => extra/solaar/default.nix} (100%) rename hosts/{programs/steam.nix => extra/steam/default.nix} (100%) rename hosts/{generic => locale}/cnix.nix (59%) diff --git a/flake.lock b/flake.lock index 1d6d145d..5bce9645 100644 --- a/flake.lock +++ b/flake.lock @@ -27,11 +27,11 @@ ] }, "locked": { - "lastModified": 1719145560, - "narHash": "sha256-LLg4I+NSx94iHsJMy1AK+UlOa0QRmzMxBmrKj2iVhtc=", + "lastModified": 1719253381, + "narHash": "sha256-ZRK+P5OSzXVOLRsVIvtC/M7dMQ5JdLQ9tlCPURBy7zY=", "owner": "nix-community", "repo": "flake-firefox-nightly", - "rev": "b42f1c6122099e4be0e5f78d7b127954a7e95e3f", + "rev": "c57cfcd3ca865b3ac291ece6b5914785fd8518b2", "type": "github" }, "original": { @@ -212,6 +212,21 @@ "type": "github" } }, + "hardware": { + "locked": { + "lastModified": 1719145664, + "narHash": "sha256-+0bBlerLxsHUJcKPDWZM1wL3V9bzCFjz+VyRTG8fnUA=", + "owner": "nixos", + "repo": "nixos-hardware", + "rev": "c3e48cbd88414f583ff08804eb57b0da4c194f9e", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixos-hardware", + "type": "github" + } + }, "hercules-ci-effects": { "inputs": { "flake-parts": "flake-parts_2", @@ -241,11 +256,11 @@ ] }, "locked": { - "lastModified": 1719037157, - "narHash": "sha256-aOKd8+mhBsLQChCu1mn/W5ww79ta5cXVE59aJFrifM8=", + "lastModified": 1719180626, + "narHash": "sha256-vZAzm5KQpR6RGple1dzmSJw5kPivES2heCFM+ZWkt0I=", "owner": "nix-community", "repo": "home-manager", - "rev": "cd886711998fe5d9ff7979fdd4b4cbd17b1f1511", + "rev": "6b1f90a8ff92e81638ae6eb48cd62349c3e387bb", "type": "github" }, "original": { @@ -301,11 +316,11 @@ ] }, "locked": { - "lastModified": 1719151941, - "narHash": "sha256-6DlzbOUC14DN3ChG6YDfHp3dlyRunlCuNIGiJ0/j0SU=", + "lastModified": 1719211247, + "narHash": "sha256-GaEckCf2RaHzoEDj/j07BIV6eyDOT5wCFVSdbbkZ87U=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "8fbf3ad99db5af164230b7965de5572ce238c0da", + "rev": "820da0e6b6127df9ad05ef3af40d767577e21ba1", "type": "github" }, "original": { @@ -317,11 +332,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1719082813, - "narHash": "sha256-C2stSASvUp0XHljA6iZfDFHSH0JIDJ0g7g0uQUIHU2E=", + "lastModified": 1719138008, + "narHash": "sha256-+rM0RjvuW6/vzxdJxEU6KvQEF159NXrgB+irtS044Cc=", "owner": "neovim", "repo": "neovim", - "rev": "6c3f7e7e27a0ffcf6d58dc1f5ad2fce7e59a2d88", + "rev": "be999e6a0e5b251b2b37500d06636d4167334c6e", "type": "github" }, "original": { @@ -363,11 +378,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1718835956, - "narHash": "sha256-wM9v2yIxClRYsGHut5vHICZTK7xdrUGfrLkXvSuv6s4=", + "lastModified": 1719145550, + "narHash": "sha256-K0i/coxxTEl30tgt4oALaylQfxqbotTSNb1/+g+mKMQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "dd457de7e08c6d06789b1f5b88fc9327f4d96309", + "rev": "e4509b3a560c87a8d4cb6f9992b8915abf9e36d8", "type": "github" }, "original": { @@ -380,6 +395,7 @@ "root": { "inputs": { "firefox-nightly": "firefox-nightly", + "hardware": "hardware", "home-manager": "home-manager", "neovim-nightly-overlay": "neovim-nightly-overlay", "nixpkgs": "nixpkgs", @@ -425,15 +441,17 @@ }, "systems_2": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "path": "/nix/store/yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "path" + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" }, "original": { - "id": "systems", - "type": "indirect" + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" } } }, diff --git a/hosts/cnix/default.nix b/hosts/cnix/default.nix index 0b14a66a..9b7e07eb 100644 --- a/hosts/cnix/default.nix +++ b/hosts/cnix/default.nix @@ -30,31 +30,16 @@ in imports = [ inputs.home-manager.nixosModules.home-manager - ../pkgs/cnix.nix ../pkgs/fonts.nix - ../programs + ../common + ../extra ../services/cnix.nix ../hardware/cnix.nix - ../generic/cnix.nix + ../locale/cnix.nix ./hardware-configuration.nix ]; - home-manager = { - useGlobalPkgs = true; - extraSpecialArgs = { - inherit inputs outputs; - }; - users = { - cnst = import ../../home/cnst/home.nix; - }; - }; - - nixpkgs = { - overlays = [ ]; - config = { - allowUnfree = true; - }; - }; + home-manager.users.cnst = import ../../home/cnst/home.nix; nix = let @@ -82,9 +67,6 @@ in nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; }; - # Add .local/bin to $PATH - environment.localBinInPath = true; - # Bootloader boot.loader = { systemd-boot.enable = true; @@ -106,10 +88,6 @@ in }; }; - # TODO: Configure your system-wide user settings (groups, etc), add more users as needed. - console.useXkbConfig = true; - # services - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion system.stateVersion = "24.05"; } diff --git a/hosts/programs/adb.nix b/hosts/common/adb.nix similarity index 100% rename from hosts/programs/adb.nix rename to hosts/common/adb.nix diff --git a/hosts/common/default.nix b/hosts/common/default.nix new file mode 100644 index 00000000..cde3246f --- /dev/null +++ b/hosts/common/default.nix @@ -0,0 +1,76 @@ +# This file (and the global directory) holds config that i use on all hosts +{ + inputs, + outputs, + pkgs, + ... +}: +{ + imports = [ + inputs.home-manager.nixosModules.home-manager + ./adb.nix + ./hyprland.nix + ./neovim.nix + ./zsh.nix + ]; + home-manager = { + useGlobalPkgs = true; + extraSpecialArgs = { + inherit inputs outputs; + }; + }; + nixpkgs = { + overlays = [ ]; + config = { + allowUnfree = true; + }; + }; + environment = { + systemPackages = [ + # Dev + pkgs.git + pkgs.pyright + pkgs.python3 + pkgs.gcc + pkgs.go + pkgs.nodePackages_latest.npm + pkgs.nodePackages_latest.nodejs + pkgs.nodePackages.prettier + pkgs.nodePackages.prettier-plugin-toml + pkgs.lua-language-server + pkgs.stylua + pkgs.prettierd + pkgs.cargo + pkgs.hyprlang + pkgs.nixd + pkgs.nil + pkgs.black + pkgs.python312Packages.jedi-language-server + pkgs.isort + pkgs.bacon + pkgs.clang + pkgs.clang-tools + pkgs.alejandra + + # Util + pkgs.stow + pkgs.gnumake + pkgs.wget + pkgs.curl + pkgs.ripgrep + pkgs.python312Packages.oauth2 + pkgs.python312Packages.httplib2 + pkgs.python312Packages.pip + pkgs.killall + pkgs.tree-sitter + pkgs.lazygit + pkgs.tmux + pkgs.tmuxifier + pkgs.unzip + pkgs.p7zip + pkgs.unrar + pkgs.xdg-utils + pkgs.xdg-user-dirs + ]; + }; +} diff --git a/hosts/programs/hyprland.nix b/hosts/common/hyprland.nix similarity index 100% rename from hosts/programs/hyprland.nix rename to hosts/common/hyprland.nix diff --git a/hosts/programs/neovim.nix b/hosts/common/neovim.nix similarity index 100% rename from hosts/programs/neovim.nix rename to hosts/common/neovim.nix diff --git a/hosts/programs/zsh.nix b/hosts/common/zsh.nix similarity index 100% rename from hosts/programs/zsh.nix rename to hosts/common/zsh.nix diff --git a/hosts/programs/nix-ld.nix b/hosts/extra/nix-ld/default.nix similarity index 100% rename from hosts/programs/nix-ld.nix rename to hosts/extra/nix-ld/default.nix diff --git a/hosts/programs/solaar.nix b/hosts/extra/solaar/default.nix similarity index 100% rename from hosts/programs/solaar.nix rename to hosts/extra/solaar/default.nix diff --git a/hosts/programs/steam.nix b/hosts/extra/steam/default.nix similarity index 100% rename from hosts/programs/steam.nix rename to hosts/extra/steam/default.nix diff --git a/hosts/generic/cnix.nix b/hosts/locale/cnix.nix similarity index 59% rename from hosts/generic/cnix.nix rename to hosts/locale/cnix.nix index 6960a672..e0991223 100644 --- a/hosts/generic/cnix.nix +++ b/hosts/locale/cnix.nix @@ -1,17 +1,4 @@ { - environment = { - etc."xdg/user-dirs.defaults".text = '' - DESKTOP=desktop - DOWNLOAD=documents/downloads - TEMPLATES=documents/templates - PUBLICSHARE=documents/share - DOCUMENTS=documents - MUSIC=media/music - PICTURES=media/photos - VIDEOS=media/video - ''; - }; - time.timeZone = "Europe/Stockholm"; i18n = {