diff --git a/nix/configurations/hydrogen.nix b/nix/configurations/hydrogen.nix index 6cc9c558..f4d95050 100644 --- a/nix/configurations/hydrogen.nix +++ b/nix/configurations/hydrogen.nix @@ -98,6 +98,7 @@ in # home modules # ./hydrogen/home/programs.nix + ./hydrogen/home/dev.nix ../homeModules/common/btop ../homeModules/common/fish diff --git a/nix/configurations/hydrogen/home/dev.nix b/nix/configurations/hydrogen/home/dev.nix new file mode 100644 index 00000000..d10f4926 --- /dev/null +++ b/nix/configurations/hydrogen/home/dev.nix @@ -0,0 +1,90 @@ +{pkgs, ...}: { + home.packages = [ + pkgs.nil # nix + pkgs.pyright # python + ]; + + programs.git = { + enable = true; + signing.signByDefault = false; # no need to setup the key + includes = let + hasconfigRemoteCondition = cfg: let + cfg' = builtins.removeAttrs cfg ["url" "path"]; + path = cfg.path or "*/**"; + in [ + (cfg' // {condition = "hasconfig:remote.*.url:git@${cfg.url}:${path}";}) + (cfg' // {condition = "hasconfig:remote.*.url:https://${cfg.url}/${path}";}) + ]; + + haskellIdentity = { + init.defaultBranch = "main"; + user.name = "Léana Jiang"; + }; + + universityIdentity = { + init.defaultBranch = "main"; + user = { + name = "Léana CHIANG"; + email = "leana.chiang@etudiant.univ-rennes1.fr"; + signingKey = "0x32035DB97E777EEB"; + }; + }; + + blameIgnore = { + blame.ignoreRevsFile = ".git-blame-ignore-revs"; + }; + in + builtins.concatMap hasconfigRemoteCondition [ + # Univ stuff + { + url = "gitlab.istic.univ-rennes1.fr"; + contents = universityIdentity; + } + { + url = "gitlab2.istic.univ-rennes1.fr"; + contents = universityIdentity; + } + + # Haskell + { + url = "gitlab.haskell.org"; + contents = haskellIdentity; + } + + # Blame + # Turning this on globally will fail if the file doesn't exist + { + url = "github.com"; + path = "nixos/nixpkgs.git"; + contents = blameIgnore; + } + { + url = "gitlab.haskell.org"; + path = "ghc/ghc.git"; + contents = blameIgnore; + } + { + url = "github.com"; + path = "haskell/cabal.git"; + contents = blameIgnore; + } + ]; + }; + + programs.gpg.enable = true; + + nix = { + settings = { + extra-substituters = [ + "https://ghc-nix.cachix.org" + "https://haskell-language-server.cachix.org" + "https://cache.iog.io" + ]; + extra-trusted-public-keys = [ + "ghc-nix.cachix.org-1:ziC/I4BPqeA4VbtOFpFpu6D1t6ymFvRWke/lc2+qjcg=" + "haskell-language-server.cachix.org-1:juFfHrwkOxqIOZShtC4YC1uT1bBcq2RSvC7OMKx0Nz8=" + "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" + ]; + }; + }; +}