diff --git a/flake.lock b/flake.lock index 291a53b..9f03769 100644 --- a/flake.lock +++ b/flake.lock @@ -670,22 +670,6 @@ "type": "github" } }, - "nixpkgs-stable_2": { - "locked": { - "lastModified": 1730327045, - "narHash": "sha256-xKel5kd1AbExymxoIfQ7pgcX6hjw9jCgbiBjiUfSVJ8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "080166c15633801df010977d9d7474b4a6c549d7", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_2": { "locked": { "lastModified": 1729413321, @@ -772,7 +756,6 @@ "impermanence": "impermanence", "lix-module": "lix-module", "nixpkgs": "nixpkgs_3", - "nixpkgs-stable": "nixpkgs-stable_2", "quickshell": "quickshell", "schizofox": "schizofox", "spicetify-nix": "spicetify-nix", diff --git a/flake.nix b/flake.nix index 7d74cc4..ad9a882 100644 --- a/flake.nix +++ b/flake.nix @@ -2,16 +2,18 @@ description = "My NixOS config flake"; outputs = inputs: let pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; + user = import ./modules/user {inherit pkgs;}; in { nixosConfigurations = import ./hosts inputs; formatter.x86_64-linux = pkgs.alejandra; devShells.x86_64-linux.default = pkgs.callPackage ./shell.nix {}; + packages.x86_64-linux = user.packages; nixosModules = { - shell = import ./modules/shell; + user = user.module; + shell = import ./modules/shell {inherit pkgs;}; }; }; inputs = { - # Unstable nixpkgs baby! nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; diff --git a/hosts/temperance/programs.nix b/hosts/temperance/programs.nix index fce1732..a6bdd8f 100644 --- a/hosts/temperance/programs.nix +++ b/hosts/temperance/programs.nix @@ -1,62 +1,61 @@ {pkgs, ...}: { - environment.systemPackages = with pkgs; - [ - alsa-utils - anki - asciinema - cachix - calc - calibre - difftastic - element-desktop - evince - eza - gcc - gnumake - halloy - helvum - httpie - imagemagick - img2pdf - impala - imv - inetutils - jujutsu - keepassxc - lazygit - libtool - nextcloud-client - nicotine-plus - swww - microfetch - nmap - nyxt - # onlyoffice-bin - pandoc - pavucontrol - pdfarranger - polkit - pulsemixer - python3 - pwvucontrol - qbittorrent - r2modman - ripgrep - signal-desktop-beta - strawberry - telegram-desktop - texliveFull - thunderbird - tor-browser - trash-cli - tutanota-desktop - typst - ungoogled-chromium - wineWowPackages.waylandFull - wireguard-tools - xdg-utils - xournalpp - zapzap - zoxide - ]; + environment.systemPackages = with pkgs; [ + alsa-utils + anki + asciinema + cachix + calc + calibre + difftastic + element-desktop + evince + eza + gcc + gnumake + halloy + helvum + httpie + imagemagick + img2pdf + impala + imv + inetutils + jujutsu + keepassxc + lazygit + libtool + nextcloud-client + nicotine-plus + swww + microfetch + nmap + nyxt + # onlyoffice-bin + pandoc + pavucontrol + pdfarranger + polkit + pulsemixer + python3 + pwvucontrol + qbittorrent + r2modman + ripgrep + signal-desktop-beta + strawberry + telegram-desktop + texliveFull + thunderbird + tor-browser + trash-cli + tutanota-desktop + typst + ungoogled-chromium + wineWowPackages.waylandFull + wireguard-tools + xdg-utils + xournalpp + zapzap + zoxide + ]; } diff --git a/modules/homix/module.nix b/modules/homix/module.nix index 5ec0883..1ed5f1b 100644 --- a/modules/homix/module.nix +++ b/modules/homix/module.nix @@ -1,6 +1,5 @@ # This is 1:1 copied from https://github.com/sioodmy/homix. # I simply put it here because it's not changing in any way anymore and i save myself a flake input this way. - { config, lib, diff --git a/modules/other/users.nix b/modules/other/users.nix index e20ee0f..d21d160 100644 --- a/modules/other/users.nix +++ b/modules/other/users.nix @@ -1,4 +1,9 @@ -{config, ...}: let +{ + config, + pkgs, + self, + ... +}: let inherit (config.meta.mainUser) username; in { users = { @@ -15,6 +20,7 @@ in { "nix" ]; homix = true; + shell = self.packages.${pkgs.stdenv.system}.fish; # hashedPasswordFile = "/etc/passwords/cr"; }; # root.hashedPasswordFile = "/persist/passwords/root"; diff --git a/modules/programs/cli/fish.nix b/modules/programs/cli/fish.nix index cb1f042..8ce3d28 100644 --- a/modules/programs/cli/fish.nix +++ b/modules/programs/cli/fish.nix @@ -18,7 +18,7 @@ in { }; config = mkIf cfg.enable { - programs.fish.enable = true; + programs.fish.enable = false; # homix.".config/fish/config.fish".source = fishinit; # users.users.${username}.shell = pkgs.fish; diff --git a/modules/programs/gui/foot.nix b/modules/programs/gui/foot.nix index 19b62d0..01c91d4 100644 --- a/modules/programs/gui/foot.nix +++ b/modules/programs/gui/foot.nix @@ -5,7 +5,7 @@ ... }: let cfg = config.modules.system.programs.terminals.foot; - colours = config.modules.style.colorScheme.colors; + colours = config.modules.style.colorScheme.colors; inherit (lib) mkIf; foot-config = pkgs.writeText "foot.ini" (lib.generators.toINI {} { diff --git a/modules/programs/gui/steam.nix b/modules/programs/gui/steam.nix index 02e0620..ceea815 100644 --- a/modules/programs/gui/steam.nix +++ b/modules/programs/gui/steam.nix @@ -11,7 +11,7 @@ in { programs.steam = { enable = true; # package = pkgs.steam; - + # .override { # extraEnv = { # MANGOHUD = true; diff --git a/modules/shell/fishinit.nix b/modules/shell/fishinit.nix deleted file mode 100644 index 58d329f..0000000 --- a/modules/shell/fishinit.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - pkgs, - aliasesStr, -}: -pkgs.writeShellScriptBin "config.fish" '' - - # source ${pkgs.fishPlugins.sponge}/share/zsh-defer/zsh-defer.plugin.zsh - ${pkgs.atuin}/bin/atuin init fish | source - ${pkgs.zoxide}/bin/zoxide init fish | source - - source ${./starship.fish} - source ${./zoxide.fish} - - source ${./config.fish} - - # zsh-defer source ${pkgs.zsh-fast-syntax-highlighting}/share/zsh/site-functions/fast-syntax-highlighting.plugin.zsh - # zsh-defer source ${pkgs.zsh-nix-shell}/share/zsh-nix-shell/nix-shell.plugin.zsh - # zsh-defer source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh - # zsh-defer source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh - # zsh-defer source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh - # zsh-defer source ${pkgs.zsh-autopair}/share/zsh/zsh-autopair/autopair.zsh - - - ${aliasesStr} -'' diff --git a/modules/user/default.nix b/modules/user/default.nix new file mode 100644 index 0000000..8549342 --- /dev/null +++ b/modules/user/default.nix @@ -0,0 +1,16 @@ +{pkgs, ...}: rec { + packages = { + fish = pkgs.callPackage ./shell {}; + }; + shell = pkgs.mkShell { + name = "bloxx-shell"; + buildInputs = [packages.fish]; + }; + module = { + config = { + environment.systemPackages = [ + shell + ]; + }; + }; +} diff --git a/modules/shell/aliases.nix b/modules/user/shell/aliases.nix similarity index 100% rename from modules/shell/aliases.nix rename to modules/user/shell/aliases.nix diff --git a/modules/shell/config.fish b/modules/user/shell/config.fish similarity index 100% rename from modules/shell/config.fish rename to modules/user/shell/config.fish diff --git a/modules/user/shell/default.nix b/modules/user/shell/default.nix new file mode 100644 index 0000000..cf78756 --- /dev/null +++ b/modules/user/shell/default.nix @@ -0,0 +1,26 @@ +# This shell setup was inspired by sioodmy. Check out his setup! +{pkgs, ...}: let + toml = pkgs.formats.toml {}; + starship-config = import ./starship.nix; + aliases = import ./aliases.nix {inherit pkgs;}; + + fishinit = import ./fishinit.nix {inherit pkgs aliasesStr;}; + + aliasesStr = + pkgs.lib.concatStringsSep "\n" + (pkgs.lib.mapAttrsToList (k: v: "alias ${k}=\"${v}\"") aliases); + packages = import ./packages.nix pkgs; +in + (pkgs.symlinkJoin { + name = "fish-wrapped"; + paths = [pkgs.fish] ++ packages; + buildInputs = [pkgs.makeWrapper]; + postBuild = '' + wrapProgram $out/bin/fish --set STARSHIP_CONFIG "${toml.generate "starship.toml" starship-config}" \ + ''; + }) + .overrideAttrs (_: { + passthru = { + shellPath = "/bin/fish"; + }; + }) diff --git a/modules/user/shell/fishinit.nix b/modules/user/shell/fishinit.nix new file mode 100644 index 0000000..3ef9eac --- /dev/null +++ b/modules/user/shell/fishinit.nix @@ -0,0 +1,16 @@ +{ + pkgs, + aliasesStr, +}: +pkgs.writeShellScriptBin "config.fish" '' + + # source ${pkgs.fishPlugins.sponge}/share/zsh-defer/zsh-defer.plugin.zsh + ${pkgs.atuin}/bin/atuin init fish | source + ${pkgs.zoxide}/bin/zoxide init fish | source + + + source ${./config.fish} + + + ${aliasesStr} +'' diff --git a/modules/shell/module2.nix b/modules/user/shell/module2.nix similarity index 94% rename from modules/shell/module2.nix rename to modules/user/shell/module2.nix index 844f2d7..f5eac7f 100644 --- a/modules/shell/module2.nix +++ b/modules/user/shell/module2.nix @@ -16,5 +16,6 @@ in (pkgs.symlinkJoin { buildInputs = [pkgs.makeWrapper]; postBuild = '' wrapProgram $out/bin/fish --set STARSHIP_CONFIG "${toml.generate "starship.toml" starship-config}" \ + --init-command source ${fishinit} ''; }) diff --git a/modules/shell/packages.nix b/modules/user/shell/packages.nix similarity index 100% rename from modules/shell/packages.nix rename to modules/user/shell/packages.nix diff --git a/modules/user/shell/starship.nix b/modules/user/shell/starship.nix new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/modules/user/shell/starship.nix @@ -0,0 +1,2 @@ +{ +}