2024-01-23 11:51:13 -06:00
|
|
|
{
|
2024-01-24 17:37:15 -06:00
|
|
|
inputs,
|
2024-01-23 11:51:13 -06:00
|
|
|
pkgs,
|
2024-07-18 11:45:57 -05:00
|
|
|
lib,
|
2024-06-10 21:59:49 -05:00
|
|
|
enabled,
|
2024-08-09 14:03:04 -05:00
|
|
|
self,
|
2024-01-23 11:51:13 -06:00
|
|
|
...
|
2024-05-06 14:32:00 -05:00
|
|
|
}:
|
2024-07-18 11:45:57 -05:00
|
|
|
let
|
|
|
|
inherit (lib) makeBinPath;
|
|
|
|
in
|
2024-05-06 14:32:00 -05:00
|
|
|
{
|
|
|
|
imports = [ inputs.nix-index-database.nixosModules.nix-index ];
|
2024-02-20 13:11:57 -06:00
|
|
|
|
2024-01-23 11:51:13 -06:00
|
|
|
nixpkgs.config.allowUnfree = true;
|
2024-05-06 14:15:05 -05:00
|
|
|
# nix.package = pkgs.nixVersions.latest;
|
2024-08-06 10:02:16 -05:00
|
|
|
nix = {
|
2024-08-09 14:03:04 -05:00
|
|
|
settings = {
|
|
|
|
experimental-features = [ "nix-command" "flakes" "pipe-operator"];
|
|
|
|
use-xdg-base-directories = true;
|
|
|
|
};
|
2024-08-06 10:02:16 -05:00
|
|
|
|
|
|
|
optimise.automatic = true;
|
|
|
|
gc = {
|
|
|
|
automatic = true;
|
|
|
|
dates = "weekly";
|
|
|
|
options = "--delete-older-than 7d";
|
|
|
|
};
|
|
|
|
|
|
|
|
# use the same nixpkgs for nix run "nixpkgs#hello" style commands
|
|
|
|
registry.nixpkgs.flake = inputs.nixpkgs;
|
2024-01-23 11:51:13 -06:00
|
|
|
};
|
2024-01-23 19:13:42 -06:00
|
|
|
|
2024-08-06 11:41:39 -05:00
|
|
|
# https://dataswamp.org/~solene/2022-07-20-nixos-flakes-command-sync-with-system.html#_nix-shell_vs_nix_shell
|
|
|
|
# use the same nixpkgs for nix-shell -p hello style commands
|
|
|
|
# I don't know that this is necesary...
|
|
|
|
# nix.nixPath = [ "nixpkgs=/etc/channels/nixpkgs" ];
|
|
|
|
# environment.etc."channels/nixpkgs".source = inputs.nixpkgs.outPath;
|
|
|
|
|
2024-05-03 12:39:28 -05:00
|
|
|
environment.systemPackages = [
|
|
|
|
pkgs.nixd
|
|
|
|
pkgs.nixfmt-rfc-style
|
2024-06-17 16:15:37 -05:00
|
|
|
pkgs.nix-output-monitor
|
|
|
|
|
2024-08-09 14:03:04 -05:00
|
|
|
self.packages.${pkgs.system}.default
|
2024-01-23 11:51:13 -06:00
|
|
|
];
|
2024-01-23 12:05:12 -06:00
|
|
|
|
2024-06-10 21:59:49 -05:00
|
|
|
programs.nix-index-database.comma = enabled;
|
2024-02-20 13:11:57 -06:00
|
|
|
|
|
|
|
# nix-index didn't like this being enabled?
|
|
|
|
programs.command-not-found.enable = false;
|
|
|
|
|
2024-06-11 15:20:49 -05:00
|
|
|
# I'm getting errors related to a non-existent nix-index?
|
|
|
|
programs.nix-index.enableZshIntegration = false;
|
2024-06-14 11:52:48 -05:00
|
|
|
programs.nix-index.enableBashIntegration = false;
|
2024-06-11 15:20:49 -05:00
|
|
|
programs.nix-index.enableFishIntegration = false;
|
|
|
|
|
2024-07-15 13:30:02 -05:00
|
|
|
system.activationScripts.diff = ''
|
|
|
|
if [[ -e /run/current-system ]]; then
|
2024-07-18 11:45:57 -05:00
|
|
|
PATH=$PATH:${
|
|
|
|
makeBinPath [
|
|
|
|
pkgs.nvd
|
|
|
|
pkgs.nix
|
|
|
|
]
|
|
|
|
}
|
|
|
|
nvd diff /run/current-system "$systemConfig"
|
2024-07-15 13:30:02 -05:00
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
2024-01-23 19:13:42 -06:00
|
|
|
nix.settings = {
|
2024-05-06 14:32:00 -05:00
|
|
|
trusted-users = [ "@wheel" ];
|
2024-01-23 19:13:42 -06:00
|
|
|
accept-flake-config = true;
|
2024-01-23 12:05:12 -06:00
|
|
|
};
|
2024-01-23 11:51:13 -06:00
|
|
|
}
|