From 849c0fef38dd7edb1e377d6cdb1249766f6e90b9 Mon Sep 17 00:00:00 2001 From: Alyxia Sother Date: Fri, 9 Jun 2023 18:25:33 +0200 Subject: [PATCH] [nix] Split up program configs into files Co-Authored-By: Winter --- nix/hosts/alymac/default.nix | 54 ++---------------------------------- nix/hosts/alymac/git.nix | 20 +++++++++++++ nix/hosts/alymac/nvim.nix | 27 ++++++++++++++++++ nix/hosts/alymac/zsh.nix | 11 ++++++++ 4 files changed, 61 insertions(+), 51 deletions(-) create mode 100644 nix/hosts/alymac/git.nix create mode 100644 nix/hosts/alymac/nvim.nix create mode 100644 nix/hosts/alymac/zsh.nix diff --git a/nix/hosts/alymac/default.nix b/nix/hosts/alymac/default.nix index 0b720b2..84340e8 100644 --- a/nix/hosts/alymac/default.nix +++ b/nix/hosts/alymac/default.nix @@ -69,8 +69,6 @@ let in { - imports = []; - # Absolutely proprietary. nixpkgs.config.allowUnfree = true; @@ -94,60 +92,14 @@ in home-manager = { useGlobalPkgs = true; useUserPackages = true; + extraSpecialArgs = { inherit dotfiles; }; users.alyxia = { pkgs, ... }: { + imports = [ ./zsh.nix ./git.nix ./nvim.nix ]; + home = { packages = packageSets.everything; }; - programs.zsh = { - enable = true; - initExtra = '' - export GPG_TTY=$(tty) - source ${dotfiles}/zsh/zshrc - ''; - }; - - programs.git = { - enable = true; - package = pkgs.gitAndTools.gitFull; # contains git send-email et al - - userName = "Alyxia Sother"; - userEmail = "alyxia@riseup.net"; - - signing = { - key = "01E16C4E775A37E4"; - signByDefault = true; - }; - - delta.enable = true; - }; - - programs.gitui.enable = true; - - programs.neovim = { - enable = true; - package = pkgs.neovim-unwrapped; - - extraConfig = "source ${dotfiles}/nvim/init.vim"; - - coc = { - enable = true; - - settings = { - languageServer = { - nix = { - command = "rnix-lsp"; - filetypes = [ "nix" ]; - }; - "go.goPlsOptions" = { - completion = true; - completeUnimported = true; - }; - }; - }; - }; - }; - # DO NOT CHANGE UNLESS YOU ARE ABSOLUTELY SURE ALL STATE AFFECTED BY THIS # OPTION IS APPROPRIATELY MIGRATED!!! home.stateVersion = "23.05"; # did you read the comment? diff --git a/nix/hosts/alymac/git.nix b/nix/hosts/alymac/git.nix new file mode 100644 index 0000000..ed686b0 --- /dev/null +++ b/nix/hosts/alymac/git.nix @@ -0,0 +1,20 @@ +{ dotfiles, ... }: + +{ + programs.git = { + enable = true; + package = pkgs.gitAndTools.gitFull; # contains git send-email et al + + userName = "Alyxia Sother"; + userEmail = "alyxia@riseup.net"; + + signing = { + key = "01E16C4E775A37E4"; + signByDefault = true; + }; + + delta.enable = true; + }; + + programs.gitui.enable = true; +} diff --git a/nix/hosts/alymac/nvim.nix b/nix/hosts/alymac/nvim.nix new file mode 100644 index 0000000..8b4f953 --- /dev/null +++ b/nix/hosts/alymac/nvim.nix @@ -0,0 +1,27 @@ +{ dotfiles, ... }: + +{ + programs.neovim = { + enable = true; + package = pkgs.neovim-unwrapped; + + extraConfig = "source ${dotfiles}/nvim/init.vim"; + + coc = { + enable = true; + + settings = { + languageServer = { + nix = { + command = "rnix-lsp"; + filetypes = [ "nix" ]; + }; + "go.goPlsOptions" = { + completion = true; + completeUnimported = true; + }; + }; + }; + }; + }; +} diff --git a/nix/hosts/alymac/zsh.nix b/nix/hosts/alymac/zsh.nix new file mode 100644 index 0000000..555273a --- /dev/null +++ b/nix/hosts/alymac/zsh.nix @@ -0,0 +1,11 @@ +{ dotfiles, ... }: + +{ + programs.zsh = { + enable = true; + initExtra = '' + export GPG_TTY=$(tty) + source ${dotfiles}/zsh/zshrc + ''; + }; +}