-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Nix configuration files for common packages and settings
- Loading branch information
Showing
6 changed files
with
121 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
lib, | ||
pkgs, | ||
inputs, | ||
system, | ||
... | ||
}: { | ||
# Nix configurations. | ||
nix = { | ||
settings = let | ||
flake = import "${inputs.self}/flake.nix"; | ||
in { | ||
# Nix will instruct remote build machines to use their own binary substitutes if available. | ||
builders-use-substitutes = true; | ||
# Experimental nix features. | ||
experimental-features = ["flakes" "nix-command"]; | ||
# Nix will fall back to building from source if a binary substitute fails. | ||
fallback = true; | ||
# The garbage collector will keep the derivations from which non-garbage store paths were built. | ||
keep-derivations = true; | ||
# The garbage collector will keep the outputs of non-garbage derivations. | ||
keep-outputs = true; | ||
# Builds will be performed in a sandboxed environment on Linux. | ||
sandbox = pkgs.stdenv.isLinux; | ||
# These users will have additional rights when connecting to the Nix daemon. | ||
trusted-users = ["root" "@wheel" "@admin"]; | ||
# Never warn about dirty Git/Mercurial trees. | ||
warn-dirty = false; | ||
# Substituters and public keys. | ||
inherit (flake.nixConfig) substituters trusted-substituters trusted-public-keys; | ||
}; | ||
# Nix automatically detects files in the store that have identical contents, and replaces them with hard links to a single copy. | ||
optimise.automatic = true; | ||
# Garbage collector | ||
gc.automatic = true; | ||
# List of directories to be searched for <...> file references. | ||
nixPath = | ||
[ | ||
"nixpkgs=flake:nixpkgs" | ||
"home-manager=flake:home-manager" | ||
] | ||
++ ( | ||
lib.optional | ||
pkgs.stdenv.isDarwin | ||
"darwin=/etc/nix/inputs/darwin" | ||
); | ||
registry = | ||
lib.mapAttrs | ||
(_n: v: {flake = v;}) | ||
(lib.filterAttrs (n: _v: !(lib.hasPrefix "nixpkgs" n) && n != "self") inputs); | ||
}; | ||
|
||
# The platform the configuration will be used on. | ||
nixpkgs.hostPlatform = system; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
pkgs, | ||
... | ||
}: { | ||
environment.systemPackages = with pkgs; [ | ||
coreutils-full | ||
curl | ||
eza | ||
fd | ||
fzf | ||
git | ||
helix | ||
home-manager | ||
htop | ||
jq | ||
man | ||
rclone | ||
ripgrep | ||
rsync | ||
tmux | ||
unzip | ||
wget | ||
zellij | ||
zoxide | ||
zstd | ||
]; | ||
|
||
programs.zsh.enable = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,26 @@ | ||
{ | ||
lib, | ||
pkgs, | ||
inputs, | ||
system, | ||
... | ||
}: { | ||
# Nix configurations. | ||
nix = { | ||
settings = let | ||
flake = import "${inputs.self}/flake.nix"; | ||
in { | ||
# Nix will instruct remote build machines to use their own binary substitutes if available. | ||
builders-use-substitutes = true; | ||
# Experimental nix features. | ||
experimental-features = ["flakes" "nix-command"]; | ||
# Nix will fall back to building from source if a binary substitute fails. | ||
fallback = true; | ||
# The garbage collector will keep the derivations from which non-garbage store paths were built. | ||
keep-derivations = true; | ||
# The garbage collector will keep the outputs of non-garbage derivations. | ||
keep-outputs = true; | ||
# Builds will be performed in a sandboxed environment on Linux. | ||
sandbox = pkgs.stdenv.isLinux; | ||
# These users will have additional rights when connecting to the Nix daemon. | ||
trusted-users = ["root" "@wheel" "@admin"]; | ||
# Never warn about dirty Git/Mercurial trees. | ||
warn-dirty = false; | ||
# Substituters and public keys. | ||
inherit (flake.nixConfig) substituters trusted-substituters trusted-public-keys; | ||
}; | ||
# Nix automatically detects files in the store that have identical contents, and replaces them with hard links to a single copy. | ||
optimise.automatic = true; | ||
# Garbage collector | ||
gc.automatic = true; | ||
# List of directories to be searched for <...> file references. | ||
nixPath = | ||
[ | ||
"nixpkgs=flake:nixpkgs" | ||
"home-manager=flake:home-manager" | ||
] | ||
++ ( | ||
lib.optional | ||
pkgs.stdenv.isDarwin | ||
"darwin=/etc/nix/inputs/darwin" | ||
); | ||
registry = | ||
lib.mapAttrs | ||
(_n: v: {flake = v;}) | ||
(lib.filterAttrs (n: _v: !(lib.hasPrefix "nixpkgs" n) && n != "self") inputs); | ||
}; | ||
imports = [ | ||
(lib.snowfall.fs.get-file | ||
"modules/common/nix/default.nix") | ||
(lib.snowfall.fs.get-file | ||
"modules/common/packages/default.nix") | ||
]; | ||
|
||
# Set Git commit hash for darwin-version. | ||
system.configurationRevision = inputs.self.rev or inputs.self.dirtyRev or null; | ||
|
||
# Auto upgrade nix package and the daemon service. | ||
services.nix-daemon.enable = true; | ||
|
||
# Create /etc/zshrc that loads the nix-darwin environment. | ||
programs.zsh.enable = true; # default shell | ||
|
||
# Home-manager automatically backup extension. | ||
home-manager.backupFileExtension = "bak"; | ||
|
||
# Used for backwards compatibility, please read the changelog before changing. | ||
# $ darwin-rebuild changelog | ||
system.stateVersion = 5; | ||
|
||
# The platform the configuration will be used on. | ||
nixpkgs.hostPlatform = system; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
lib, | ||
namespace, | ||
config, | ||
... | ||
}: let | ||
cfg = config.${namespace}.programs.terminal.neovim; | ||
in { | ||
options.${namespace}.programs.terminal.neovim = { | ||
enable = lib.mkOption { | ||
type = lib.types.bool; | ||
default = false; | ||
description = "Whether to enable neovim."; | ||
}; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
programs.neovim = { | ||
enable = true; | ||
viAlias = true; | ||
vimAlias = true; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters