Rename and refactor Darwin-specific modules
Renamed several modules to better align with Darwin-specific configurations. Refactored configuration for Alacritty and removed it from system packages where not needed. Introduced Homebrew settings and cleaned up redundant entries in multiple Nix files.
This commit is contained in:
parent
f5670d2c0e
commit
cbe03d1060
|
@ -9,11 +9,9 @@
|
||||||
username = "harald";
|
username = "harald";
|
||||||
homeDirectory = "/Users/${config.home.username}";
|
homeDirectory = "/Users/${config.home.username}";
|
||||||
stateVersion = "23.11"; # Please read the comment before changing.
|
stateVersion = "23.11"; # Please read the comment before changing.
|
||||||
# sessionPath = [ "$HOME/bin" ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
metacfg = {
|
metacfg = {
|
||||||
|
|
||||||
cli-apps = {
|
cli-apps = {
|
||||||
bash.enable = true;
|
bash.enable = true;
|
||||||
fish.enable = true;
|
fish.enable = true;
|
||||||
|
@ -24,9 +22,15 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
tools = {
|
tools = {
|
||||||
direnv.enable = true;
|
#direnv.enable = true;
|
||||||
ssh.enable = true;
|
ssh.enable = true;
|
||||||
git.enable = true;
|
git.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
xdg.configFile."alacritty/alacritty.toml".source = (pkgs.formats.toml { }).generate "alacritty-config" {
|
||||||
|
font = {
|
||||||
|
size = 17;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
tools = {
|
tools = {
|
||||||
direnv.enable = true;
|
|
||||||
ssh.enable = true;
|
ssh.enable = true;
|
||||||
git.enable = true;
|
git.enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,6 +24,11 @@ in
|
||||||
nix-prefetch-git
|
nix-prefetch-git
|
||||||
];
|
];
|
||||||
|
|
||||||
|
homebrew = {
|
||||||
|
enable = true;
|
||||||
|
onActivation.autoUpdate = false;
|
||||||
|
};
|
||||||
|
|
||||||
nix =
|
nix =
|
||||||
let
|
let
|
||||||
users = [
|
users = [
|
||||||
|
@ -34,34 +39,35 @@ in
|
||||||
{
|
{
|
||||||
package = cfg.package;
|
package = cfg.package;
|
||||||
|
|
||||||
settings = {
|
settings =
|
||||||
experimental-features = "nix-command flakes";
|
{
|
||||||
http-connections = 50;
|
experimental-features = "nix-command flakes";
|
||||||
warn-dirty = false;
|
http-connections = 50;
|
||||||
log-lines = 50;
|
warn-dirty = false;
|
||||||
|
log-lines = 50;
|
||||||
|
|
||||||
# Large builds apparently fail due to an issue with darwin:
|
# Large builds apparently fail due to an issue with darwin:
|
||||||
# https://github.com/NixOS/nix/issues/4119
|
# https://github.com/NixOS/nix/issues/4119
|
||||||
sandbox = false;
|
sandbox = false;
|
||||||
|
|
||||||
# This appears to break on darwin
|
# This appears to break on darwin
|
||||||
# https://github.com/NixOS/nix/issues/7273
|
# https://github.com/NixOS/nix/issues/7273
|
||||||
auto-optimise-store = false;
|
auto-optimise-store = false;
|
||||||
|
|
||||||
allow-import-from-derivation = true;
|
allow-import-from-derivation = true;
|
||||||
|
|
||||||
trusted-users = users;
|
trusted-users = users;
|
||||||
allowed-users = users;
|
allowed-users = users;
|
||||||
|
|
||||||
# NOTE: This configuration is generated by nix-installer so I'm adding it here in
|
# NOTE: This configuration is generated by nix-installer so I'm adding it here in
|
||||||
# case it becomes important.
|
# case it becomes important.
|
||||||
extra-nix-path = "nixpkgs=flake:nixpkgs";
|
extra-nix-path = "nixpkgs=flake:nixpkgs";
|
||||||
build-users-group = "nixbld";
|
build-users-group = "nixbld";
|
||||||
};
|
}
|
||||||
#// (lib.optionalAttrs config.metacfg.tools.direnv.enable {
|
// (lib.optionalAttrs config.metacfg.tools.direnv.enable {
|
||||||
# keep-outputs = true;
|
keep-outputs = true;
|
||||||
# keep-derivations = true;
|
keep-derivations = true;
|
||||||
#});
|
});
|
||||||
|
|
||||||
gc = {
|
gc = {
|
||||||
automatic = true;
|
automatic = true;
|
||||||
|
|
|
@ -19,7 +19,6 @@ in
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
environment = {
|
environment = {
|
||||||
systemPackages = with pkgs; [
|
systemPackages = with pkgs; [
|
||||||
alacritty
|
|
||||||
age
|
age
|
||||||
delta
|
delta
|
||||||
git
|
git
|
||||||
|
@ -45,6 +44,12 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
fish.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPath = [ /run/current-system/sw/bin ];
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
bash = {
|
bash = {
|
||||||
## shellInit = ''
|
## shellInit = ''
|
||||||
|
@ -53,7 +58,6 @@ in
|
||||||
bind '"\e[B": history-search-forward'
|
bind '"\e[B": history-search-forward'
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
fish.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
security = {
|
security = {
|
||||||
|
|
18
modules/darwin/tools/alacritty/default.nix
Normal file
18
modules/darwin/tools/alacritty/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib) mkEnableOption mkIf;
|
||||||
|
|
||||||
|
cfg = config.metacfg.tools.alacritty;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.metacfg.tools.alacritty = {
|
||||||
|
enable = mkEnableOption "alacritty";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ alacritty ]; };
|
||||||
|
}
|
|
@ -1,29 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
inherit (lib) mkEnableOption mkIf;
|
|
||||||
|
|
||||||
cfg = config.metacfg.tools.alacritty;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.metacfg.tools.alacritty = {
|
|
||||||
enable = mkEnableOption "alacritty";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
alacritty
|
|
||||||
(pkgs.nerdfonts.override {
|
|
||||||
fonts = [
|
|
||||||
"FiraCode"
|
|
||||||
"DroidSansMono"
|
|
||||||
"JetBrainsMono"
|
|
||||||
];
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -6,6 +6,9 @@ with lib.metacfg;
|
||||||
suites = {
|
suites = {
|
||||||
common = enabled;
|
common = enabled;
|
||||||
};
|
};
|
||||||
|
tools = {
|
||||||
|
direnv.enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
|
Loading…
Reference in a new issue