refactor(flake)!: deduplicate code in configurations
flake module
Pass around `perSystem`'s `pkgs` instances to the system configurations Some more refactoring in `configurations`' `mkHost` functions Also start using `home-manager`'s `useGlobalPkgs` option Also use `mkShellNoCC` for default `devShell` Also `nix flake update`
This commit is contained in:
parent
eeae48b5d8
commit
e3b1539b41
19 changed files with 183 additions and 246 deletions
|
@ -8,10 +8,21 @@
|
|||
# Auto upgrade nix package and the daemon service.
|
||||
services.nix-daemon.enable = true;
|
||||
|
||||
nix = {
|
||||
nix = let
|
||||
flakeInputs = lib.filterAttrs (lib.const (lib.isType "flake")) inputs;
|
||||
in {
|
||||
# Ensure we can work with flakes
|
||||
# NOTE: run `sudo -i nix-env --uninstall nix` to uninstall the global `nix`
|
||||
package = pkgs.nixVersions.monitored.latest;
|
||||
|
||||
# This will add each flake input as a registry
|
||||
# To make nix3 commands consistent with your flake
|
||||
registry = lib.mapAttrs (_: value: { flake = value; }) flakeInputs;
|
||||
|
||||
# This will additionally add your inputs to the system's legacy channels
|
||||
# Making legacy nix commands consistent as well, awesome!
|
||||
nixPath = lib.mapAttrsToList (key: value: "${key}=flake:${key}") flakeInputs;
|
||||
|
||||
# extraOptions = ''
|
||||
# # Enable flakes and new 'nix' command
|
||||
# experimental-features = nix-command flakes
|
||||
|
@ -24,15 +35,6 @@
|
|||
# keep-derivations = true
|
||||
# '';
|
||||
|
||||
# registry.nixpkgs.flake = inputs.nixpkgs;
|
||||
# registry =
|
||||
# lib.mapAttrs'
|
||||
# (name: value:
|
||||
# {
|
||||
# name = name;
|
||||
# value = { flake = value; };
|
||||
# })
|
||||
# inputs;
|
||||
|
||||
settings = {
|
||||
# Enable flakes and new 'nix' command
|
||||
|
@ -89,8 +91,7 @@
|
|||
programs.zsh.enable = true; # default shell on catalina
|
||||
|
||||
# Fonts
|
||||
fonts.fontDir.enable = true;
|
||||
fonts.fonts = with pkgs; [
|
||||
fonts.packages = with pkgs; [
|
||||
(nerdfonts.override { fonts = [ "FiraCode" ]; })
|
||||
];
|
||||
|
||||
|
|
|
@ -7,14 +7,6 @@
|
|||
stateVersion = "23.05";
|
||||
};
|
||||
|
||||
# Add custom overlays
|
||||
nixpkgs = {
|
||||
overlays = builtins.attrValues outputs.overlays ++ [
|
||||
inputs.neovim-nightly-overlay.overlays.default
|
||||
inputs.zig-overlay.overlays.default
|
||||
];
|
||||
};
|
||||
|
||||
# Set env vars
|
||||
home.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
|
@ -40,18 +32,33 @@
|
|||
|
||||
# Neovim
|
||||
neovim
|
||||
# (neovim.overrideAttrs (oldAttrs: {
|
||||
# lua = luajitcoroutineclone;
|
||||
# }))
|
||||
(pkgs.writeShellScriptBin "lua" "exec -a $0 ${luajitPackages.nlua}/bin/nlua $@")
|
||||
# luajitPackages.nlua
|
||||
fennel
|
||||
fennel-language-server
|
||||
# fennel-language-server
|
||||
fennel-ls
|
||||
git
|
||||
gh
|
||||
|
||||
# (gnumake.override { guileSupport = true; })
|
||||
gnumake
|
||||
|
||||
# # Emacs
|
||||
# (emacs-unstable.override {
|
||||
# withGTK3 = true;
|
||||
# :
|
||||
# })
|
||||
|
||||
# Dhall
|
||||
dhall
|
||||
# dhall
|
||||
# dhall-lsp-server
|
||||
|
||||
# Circom
|
||||
circom
|
||||
circom-lsp
|
||||
# circom
|
||||
# circom-lsp
|
||||
|
||||
# Nix
|
||||
nil
|
||||
|
@ -61,6 +68,9 @@
|
|||
# Mail
|
||||
# himalaya
|
||||
|
||||
# Java
|
||||
graalvm-ce
|
||||
|
||||
# SSH and GPG
|
||||
openssh
|
||||
gnupg
|
||||
|
@ -99,8 +109,27 @@
|
|||
wezterm = {
|
||||
enable = true;
|
||||
};
|
||||
spotify = {
|
||||
enable = false;
|
||||
};
|
||||
};
|
||||
|
||||
# programs.git = {
|
||||
# enable = true;
|
||||
# userName = "reo101";
|
||||
# # userEmail = "pavel.atanasov@limechain.tech";
|
||||
# userEmail = "pavel.atanasov2001@gmail.com";
|
||||
# signing = {
|
||||
# signByDefault = true;
|
||||
# key = "675AA7EF13964ACB";
|
||||
# };
|
||||
# # init.defaultBranch = "master";
|
||||
# lfs = {
|
||||
# enable = true;
|
||||
# };
|
||||
# };
|
||||
|
||||
|
||||
home.file.".gnupg/gpg-agent.conf" = {
|
||||
text = ''
|
||||
allow-preset-passphrase
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue