diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index 48f97f7..658b9e2 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -22,7 +22,6 @@ }; terminal.package = pkgs.kitty; programs.exercism.enable = true; - services.mullvad.enable = true; }; users.users.moritz.packages = [ pkgs.poetry ]; diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index 6d301d6..9aa5607 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -187,6 +187,7 @@ in rs = "sudo systemctl"; uj = "journalctl --user"; rj = "sudo journalctl"; + lg = "lazygit"; }; aliases = { ls = "${getExe pkgs.eza} -lh --icons --git"; @@ -197,7 +198,6 @@ in variables = { EDITOR = "vim"; }; }; programs = { - lazygit.enable = true; direnv.enable = true; fish.enable = true; git.enable = true; @@ -265,10 +265,6 @@ in programs = { mtr.enable = true; command-not-found.enable = false; - nh = { - enable = true; - flake = "/home/moritz/Documents/dotfiles/"; - }; }; services = { @@ -303,6 +299,65 @@ in ]; }; starship.enable = true; + lazygit.enable = true; + lazygit.settings = { + customCommands = [ + { + key = ""; + context = "global"; + description = "Create new conventional commit"; + prompts = [ + { + type = "menu"; + key = "Type"; + title = "Type of change"; + options = [ + { name = "build"; description = "Changes that affect the build system or external dependencies"; value = "build"; } + { name = "feat"; description = "A new feature"; value = "feat"; } + { name = "fix"; description = "A bug fix"; value = "fix"; } + { name = "chore"; description = "Other changes that don't modify src or test files"; value = "chore"; } + { name = "ci"; description = "Changes to CI configuration files and scripts"; value = "ci"; } + { name = "docs"; description = "Documentation only changes"; value = "docs"; } + { name = "perf"; description = "A code change that improves performance"; value = "perf"; } + { name = "refactor"; description = "A code change that neither fixes a bug nor adds a feature"; value = "refactor"; } + { name = "revert"; description = "Reverts a previous commit"; value = "revert"; } + { name = "style"; description = "Changes that do not affect the meaning of the code"; value = "style"; } + { name = "test"; description = "Adding missing tests or correcting existing tests"; value = "test"; } + ]; + } + { + type = "input"; + title = "Scope"; + key = "Scope"; + initialValue = ""; + } + { + type = "menu"; + key = "Breaking"; + title = "Breaking change"; + options = [ + { name = "no"; value = ""; } + { name = "yes"; value = "!"; } + ]; + } + { + type = "input"; + title = "message"; + key = "Message"; + initialValue = ""; + } + { + type = "confirm"; + key = "Confirm"; + title = "Commit"; + body = "Are you sure you want to commit?"; + } + ]; + command = "git commit --message '{{.Form.Type}}{{ if .Form.Scope }}({{ .Form.Scope }}){{ end }}{{.Form.Breaking}}: {{.Form.Message}}'"; + loadingText = "Creating conventional commit..."; + } + ]; + }; }; home = { username = "moritz"; diff --git a/modules/profiles/impermanence.nix b/modules/profiles/impermanence.nix index 93568f7..c5113e7 100644 --- a/modules/profiles/impermanence.nix +++ b/modules/profiles/impermanence.nix @@ -27,7 +27,6 @@ in "/var/lib/nixos" "/var/lib/systemd" "/var/log" - "/etc/mullvad-vpn/" ]; files = [ "/etc/machine-id" diff --git a/modules/programs/lazygit.nix b/modules/programs/lazygit.nix deleted file mode 100644 index e3a07ca..0000000 --- a/modules/programs/lazygit.nix +++ /dev/null @@ -1,95 +0,0 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.programs.lazygit; - - wrapper = pkgs.writeShellApplication { - name = "lg"; - text = '' - export LAZYGIT_NEW_DIR_FILE="$HOME/.lazygit/newdir" - - lazygit "$@" - - if [ -f "$LAZYGIT_NEW_DIR_FILE" ]; then - cd "$(cat "$LAZYGIT_NEW_DIR_FILE")" - rm -f "$LAZYGIT_NEW_DIR_FILE" > /dev/null - fi - ''; - runtimeInputs = [ pkgs.lazygit ]; - }; -in -{ - options.my.programs.lazygit.enable = mkEnableOption "lazygit"; - - config = mkIf cfg.enable { - home-manager.users.moritz.home.packages = [ - wrapper - ]; - home-manager.users.moritz.programs.lazygit = { - enable = true; - settings = { - customCommands = [ - { - key = ""; - context = "global"; - description = "Create new conventional commit"; - prompts = [ - { - type = "menu"; - key = "Type"; - title = "Type of change"; - options = [ - { name = "build"; description = "Changes that affect the build system or external dependencies"; value = "build"; } - { name = "feat"; description = "A new feature"; value = "feat"; } - { name = "fix"; description = "A bug fix"; value = "fix"; } - { name = "chore"; description = "Other changes that don't modify src or test files"; value = "chore"; } - { name = "ci"; description = "Changes to CI configuration files and scripts"; value = "ci"; } - { name = "docs"; description = "Documentation only changes"; value = "docs"; } - { name = "perf"; description = "A code change that improves performance"; value = "perf"; } - { name = "refactor"; description = "A code change that neither fixes a bug nor adds a feature"; value = "refactor"; } - { name = "revert"; description = "Reverts a previous commit"; value = "revert"; } - { name = "style"; description = "Changes that do not affect the meaning of the code"; value = "style"; } - { name = "test"; description = "Adding missing tests or correcting existing tests"; value = "test"; } - ]; - } - { - type = "input"; - title = "Scope"; - key = "Scope"; - initialValue = ""; - } - { - type = "menu"; - key = "Breaking"; - title = "Breaking change"; - options = [ - { name = "no"; value = ""; } - { name = "yes"; value = "!"; } - ]; - } - { - type = "input"; - title = "message"; - key = "Message"; - initialValue = ""; - } - { - type = "confirm"; - key = "Confirm"; - title = "Commit"; - body = "Are you sure you want to commit?"; - } - ]; - command = "git commit --message '{{.Form.Type}}{{ if .Form.Scope }}({{ .Form.Scope }}){{ end }}{{.Form.Breaking}}: {{.Form.Message}}'"; - loadingText = "Creating conventional commit..."; - } - ]; - }; - }; - }; -} diff --git a/modules/programs/nix.nix b/modules/programs/nix.nix index 2dfc969..c98c643 100644 --- a/modules/programs/nix.nix +++ b/modules/programs/nix.nix @@ -10,6 +10,12 @@ let inherit (lib) mkEnableOption mkOption types; cfg = config.my.programs.nix; + mkNom = system: nix: + inputs.nix-monitored.packages.${system}.default.override + { + withNotify = false; + nix = nix; + }; in { options.my.programs.nix = { @@ -25,6 +31,15 @@ in }; config = { + my.nixpkgs.overlays = [ + (final: prev: + { + nixos-rebuild = prev.nixos-rebuild.override { + nix = mkNom final.system final.nix; + }; + }) + ]; + home-manager.users.moritz.programs.direnv.nix-direnv.package = pkgs.nix-direnv.override { nix = config.nix.package; }; @@ -34,7 +49,7 @@ in nix = { nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; - package = pkgs.lix; + package = pkgs.nix; extraOptions = '' !include ${config.age.secrets.nix-github-token.path} diff --git a/modules/programs/nvim/new_plugins/lsp.nix b/modules/programs/nvim/new_plugins/lsp.nix index afc64ab..8a001f5 100644 --- a/modules/programs/nvim/new_plugins/lsp.nix +++ b/modules/programs/nvim/new_plugins/lsp.nix @@ -8,11 +8,6 @@ in plugins.lsp = { enable = true; inlayHints = true; - servers.rust_analyzer = { - enable = true; - installRustc = false; - installCargo = false; - }; servers.elixirls.enable = true; servers.nextls.enable = true; servers.nil_ls.enable = true; @@ -23,7 +18,7 @@ in }; options = { nixos = { - expr = ''builtins.head (builtins.attrValues ((builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations).options''; + expr = ''(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.nixos-desktop.options''; }; "flake-parts" = { expr = ''(builtins.getFlake ("git+file://" + toString ./.)).debug.options'';