diff --git a/flake.lock b/flake.lock index 822b130a..a1ef560a 100644 --- a/flake.lock +++ b/flake.lock @@ -27,11 +27,11 @@ ] }, "locked": { - "lastModified": 1719491277, - "narHash": "sha256-eC3o+NXisjCOp2859tKN4gHrk5wkstMsqdrmWFkcagY=", + "lastModified": 1719536494, + "narHash": "sha256-WTBaxRyhV2EK7CYtqcZ+bBxur5cjKFqEPVKaO4NWaeY=", "owner": "nix-community", "repo": "flake-firefox-nightly", - "rev": "6086714009c9771504f2355d665d4a543f359ab3", + "rev": "3a1a6fc8a6451659057be488405db9e2098138db", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 991e0565..30ad61c9 100644 --- a/flake.nix +++ b/flake.nix @@ -27,50 +27,45 @@ inputs.nixpkgs.follows = "nixpkgs"; }; # Home manager - }; - outputs = - { - self, - nixpkgs, - home-manager, - systems, - solaar, - ... - }@inputs: - let - inherit (self) outputs; - lib = nixpkgs.lib // home-manager.lib; - forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system}); - pkgsFor = lib.genAttrs (import systems) ( - system: + outputs = { + self, + nixpkgs, + home-manager, + systems, + solaar, + ... + } @ inputs: let + inherit (self) outputs; + lib = nixpkgs.lib // home-manager.lib; + forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system}); + pkgsFor = lib.genAttrs (import systems) ( + system: import nixpkgs { inherit system; config.allowUnfree = true; } - ); - in - { - inherit lib; - formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt); + ); + in { + inherit lib; + formatter = forEachSystem (pkgs: pkgs.alejandra); - nixosConfigurations = { - - cnix = lib.nixosSystem { - modules = [ - ./hosts/cnix - # solaar.nixosModules.default - ]; - specialArgs = { - inherit inputs outputs; - }; + nixosConfigurations = { + cnix = lib.nixosSystem { + modules = [ + ./hosts/cnix + # solaar.nixosModules.default + ]; + specialArgs = { + inherit inputs outputs; }; - adampad = lib.nixosSystem { - modules = [ ./hosts/adampad ]; - specialArgs = { - inherit inputs outputs; - }; + }; + adampad = lib.nixosSystem { + modules = [./hosts/adampad]; + specialArgs = { + inherit inputs outputs; }; }; }; + }; } diff --git a/home/core/adam.nix b/home/core/adam.nix index 9341b752..1d9ed241 100644 --- a/home/core/adam.nix +++ b/home/core/adam.nix @@ -1,4 +1,3 @@ -{ pkgs, ... }: { imports = [ ./git @@ -6,31 +5,4 @@ ./shell/adam.nix ./appearance ]; - home.packages = with pkgs; [ - # Desktop - alacritty - wl-clipboard - keepassxc - ranger - webcord - xfce.thunar - xfce.thunar-volman - xfce.thunar-archive-plugin - gnome.file-roller - wireguard-tools - wpa_supplicant - ntfs3g - kdePackages.polkit-kde-agent-1 - networkmanagerapplet - htop - btop - pamixer - qbittorrent - fastfetch - waybar - nwg-look - thefuck - calcurse - gnome.adwaita-icon-theme - ]; } diff --git a/home/core/cnst.nix b/home/core/cnst.nix index 02b5aa36..d1456f7d 100644 --- a/home/core/cnst.nix +++ b/home/core/cnst.nix @@ -1,4 +1,3 @@ -{ pkgs, ... }: { imports = [ ./git @@ -6,32 +5,4 @@ ./shell/cnst.nix ./appearance ]; - home.packages = with pkgs; [ - # Desktop - alacritty - wl-clipboard - keepassxc - ranger - webcord - xfce.thunar - xfce.thunar-volman - xfce.thunar-archive-plugin - gnome.file-roller - wireguard-tools - wpa_supplicant - ntfs3g - kdePackages.polkit-kde-agent-1 - networkmanagerapplet - htop - btop - pamixer - virt-manager - qbittorrent - fastfetch - waybar - nwg-look - thefuck - calcurse - gnome.adwaita-icon-theme - ]; } diff --git a/home/core/hypr/default.nix b/home/core/hypr/default.nix index b8126e3f..2fc15693 100644 --- a/home/core/hypr/default.nix +++ b/home/core/hypr/default.nix @@ -5,7 +5,7 @@ ... }: { - imports = [ ../mako ]; + imports = [ ../../extra/mako ]; xdg.portal = let diff --git a/home/extra/adam.nix b/home/extra/adam.nix index e779841e..5933766f 100644 --- a/home/extra/adam.nix +++ b/home/extra/adam.nix @@ -4,7 +4,6 @@ ./zellij ./firefox ./neovim - ./mako ]; home.packages = with pkgs; [ # Desktop diff --git a/home/extra/cnst.nix b/home/extra/cnst.nix index 84c8e592..a7888881 100644 --- a/home/extra/cnst.nix +++ b/home/extra/cnst.nix @@ -2,7 +2,6 @@ { imports = [ ./firefox - ./mako ./neovim ./zellij ]; diff --git a/home/extra/neovim/default.nix b/home/extra/neovim/default.nix index acf7e785..4c5bcb6b 100644 --- a/home/extra/neovim/default.nix +++ b/home/extra/neovim/default.nix @@ -1,7 +1,9 @@ -{ pkgs, inputs, ... }: -with pkgs; -let - +{ + pkgs, + inputs, + ... +}: +with pkgs; let tools = [ fswatch # File watcher utility, replacing libuv.fs_event for neovim 10.0 fzf @@ -50,15 +52,16 @@ let nix = [ alejandra nixd - nixfmt-rfc-style + nil nixpkgs-fmt statix ]; python = [ + pyright black isort - python311Packages.jedi-language-server + python312Packages.jedi-language-server ruff ruff-lsp ]; @@ -79,6 +82,7 @@ let deno nodePackages.sql-formatter nodePackages.typescript-language-server + nodePackages.prettier nodejs prettierd # multi-language formatters vscode-langservers-extracted @@ -87,9 +91,7 @@ let extraPackages = tools ++ c ++ gamedev ++ golang ++ lua ++ markup ++ nix ++ python ++ rust ++ shell ++ web; -in - -{ +in { # for quick development home.packages = rust; @@ -97,7 +99,7 @@ in enable = true; defaultEditor = true; package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default; - plugins = with pkgs.vimPlugins; [ telescope-cheat-nvim ]; + plugins = with pkgs.vimPlugins; [telescope-cheat-nvim]; inherit extraPackages; }; } diff --git a/hosts/adampad/default.nix b/hosts/adampad/default.nix index 80f5b11b..72e3d043 100644 --- a/hosts/adampad/default.nix +++ b/hosts/adampad/default.nix @@ -6,11 +6,9 @@ pkgs, system, ... -}: -let +}: let ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; -in -{ +in { users.users.adam = { isNormalUser = true; shell = pkgs.zsh; @@ -30,7 +28,7 @@ in imports = [ inputs.home-manager.nixosModules.home-manager - ../common + ../core ../services/adampad.nix ../hardware/adampad.nix ../locale/adampad.nix @@ -38,31 +36,29 @@ in ]; home-manager.users.adam = import ../../home/adam/home.nix; - nix = - let - flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; - in - { - settings = { - auto-optimise-store = lib.mkDefault true; - warn-dirty = false; - # Enable flakes and new 'nix' command - experimental-features = [ - "nix-command" - "flakes" - ]; - # Opinionated: disable global registry - flake-registry = ""; - # Workaround for https://github.com/NixOS/nix/issues/9574 - nix-path = config.nix.nixPath; - }; - # Opinionated: disable channels - channel.enable = false; - - # Opinionated: make flake registry and nix path match flake inputs - registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs; - nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; + nix = let + flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; + in { + settings = { + auto-optimise-store = lib.mkDefault true; + warn-dirty = false; + # Enable flakes and new 'nix' command + experimental-features = [ + "nix-command" + "flakes" + ]; + # Opinionated: disable global registry + flake-registry = ""; + # Workaround for https://github.com/NixOS/nix/issues/9574 + nix-path = config.nix.nixPath; }; + # Opinionated: disable channels + channel.enable = false; + + # Opinionated: make flake registry and nix path match flake inputs + registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs; + nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; + }; # Bootloader boot.loader = { diff --git a/hosts/cnix/default.nix b/hosts/cnix/default.nix index c33ccd93..40c53506 100644 --- a/hosts/cnix/default.nix +++ b/hosts/cnix/default.nix @@ -6,11 +6,9 @@ pkgs, system, ... -}: -let +}: let ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; -in -{ +in { users.users.cnst = { isNormalUser = true; shell = pkgs.zsh; @@ -30,7 +28,7 @@ in imports = [ inputs.home-manager.nixosModules.home-manager - ../common + ../core ../extra/steam ../extra/nix-ld ../services/cnix.nix @@ -40,31 +38,29 @@ in ]; home-manager.users.cnst = import ../../home/cnst/home.nix; - nix = - let - flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; - in - { - settings = { - auto-optimise-store = lib.mkDefault true; - warn-dirty = false; - # Enable flakes and new 'nix' command - experimental-features = [ - "nix-command" - "flakes" - ]; - # Opinionated: disable global registry - flake-registry = ""; - # Workaround for https://github.com/NixOS/nix/issues/9574 - nix-path = config.nix.nixPath; - }; - # Opinionated: disable channels - channel.enable = false; - - # Opinionated: make flake registry and nix path match flake inputs - registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs; - nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; + nix = let + flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; + in { + settings = { + auto-optimise-store = lib.mkDefault true; + warn-dirty = false; + # Enable flakes and new 'nix' command + experimental-features = [ + "nix-command" + "flakes" + ]; + # Opinionated: disable global registry + flake-registry = ""; + # Workaround for https://github.com/NixOS/nix/issues/9574 + nix-path = config.nix.nixPath; }; + # Opinionated: disable channels + channel.enable = false; + + # Opinionated: make flake registry and nix path match flake inputs + registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs; + nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; + }; # Bootloader boot.loader = { diff --git a/hosts/common/cnix-pkgs.nix b/hosts/common/cnix-pkgs.nix deleted file mode 100644 index cd40e61b..00000000 --- a/hosts/common/cnix-pkgs.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ pkgs, ... }: -{ - environment = { - systemPackages = [ - # Dev - 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 - pkgs.nixpkgs-fmt - - # Util - pkgs.python312Packages.pip - pkgs.tmux - pkgs.tmuxifier - ]; - }; -} diff --git a/hosts/common/adampad-pkgs.nix b/hosts/core/adampad-pkgs.nix similarity index 100% rename from hosts/common/adampad-pkgs.nix rename to hosts/core/adampad-pkgs.nix diff --git a/hosts/common/adb.nix b/hosts/core/adb.nix similarity index 100% rename from hosts/common/adb.nix rename to hosts/core/adb.nix diff --git a/hosts/core/cnix-pkgs.nix b/hosts/core/cnix-pkgs.nix new file mode 100644 index 00000000..167b98b0 --- /dev/null +++ b/hosts/core/cnix-pkgs.nix @@ -0,0 +1,14 @@ +{pkgs, ...}: { + environment = { + systemPackages = [ + # Dev + pkgs.fd + pkgs.python3 + pkgs.hyprlang + + # Util + pkgs.tmux + pkgs.tmuxifier + ]; + }; +} diff --git a/hosts/common/default.nix b/hosts/core/default.nix similarity index 100% rename from hosts/common/default.nix rename to hosts/core/default.nix diff --git a/hosts/common/fonts.nix b/hosts/core/fonts.nix similarity index 100% rename from hosts/common/fonts.nix rename to hosts/core/fonts.nix diff --git a/hosts/common/zsh.nix b/hosts/core/zsh.nix similarity index 100% rename from hosts/common/zsh.nix rename to hosts/core/zsh.nix diff --git a/hosts/extra/nix-ld/default.nix b/hosts/extra/nix-ld/default.nix index 6d7f3494..c6b59324 100644 --- a/hosts/extra/nix-ld/default.nix +++ b/hosts/extra/nix-ld/default.nix @@ -1,5 +1,91 @@ +{pkgs, ...}: { programs.nix-ld = { enable = true; - }; + # Sets up all the libraries to load + libraries = with pkgs; [ + stdenv.cc.cc + openssl + xorg.libXcomposite + xorg.libXtst + xorg.libXrandr + xorg.libXext + xorg.libX11 + xorg.libXfixes + libGL + libva + xorg.libxcb + xorg.libXdamage + xorg.libxshmfence + xorg.libXxf86vm + libelf + glib + gtk3 + bzip2 + xorg.libXinerama + xorg.libXcursor + xorg.libXrender + xorg.libXScrnSaver + xorg.libXi + xorg.libSM + xorg.libICE + gnome2.GConf + nspr + nss + cups + libcap + SDL2 + libusb1 + dbus-glib + ffmpeg + libudev0-shim + xorg.libXt + xorg.libXmu + libogg + libvorbis + SDL + SDL2_image + glew110 + libidn + tbb + flac + freeglut + libjpeg + libpng + libpng12 + libsamplerate + libmikmod + libtheora + libtiff + pixman + speex + SDL_image + SDL_ttf + SDL_mixer + SDL2_ttf + SDL2_mixer + libappindicator-gtk2 + libdbusmenu-gtk2 + libindicator-gtk2 + libcaca + libcanberra + libgcrypt + libvpx + librsvg + xorg.libXft + libvdpau + gnome2.pango + cairo + atk + gdk-pixbuf + fontconfig + freetype + dbus + alsaLib + expat + libdrm + mesa + libxkbcommon +]; +}; } diff --git a/hosts/extra/steam/default.nix b/hosts/extra/steam/default.nix index 28476e2b..6d919295 100644 --- a/hosts/extra/steam/default.nix +++ b/hosts/extra/steam/default.nix @@ -17,7 +17,6 @@ keyutils gamescope mangohud - steam-run ]; }; };