Make common modules compatible for nix-darwin
TODO: Determine why nushell config is populated twice
This commit is contained in:
parent
d20c9ac3bd
commit
53b8448159
33 changed files with 114 additions and 98 deletions
9
Justfile
9
Justfile
|
|
@ -1,13 +1,16 @@
|
|||
set shell := ["nu", "-c"]
|
||||
set shell := ["bash", "-c"]
|
||||
editor := env('EDITOR')
|
||||
rebuild := if os() == "linux" { "nixos-rebuild" } else { "darwin-rebuild" }
|
||||
|
||||
default:
|
||||
@just --list --justfile {{justfile()}}
|
||||
|
||||
# Runs `nixos-rebuild`
|
||||
# TODO: Run `pre-commit install` at some point
|
||||
|
||||
# Runs `nixos-rebuild` or `darwin-rebuild` depending on the OS
|
||||
[group('nix')]
|
||||
deploy:
|
||||
nixos-rebuild switch --flake . --use-remote-sudo
|
||||
sudo {{rebuild}} switch --flake .
|
||||
|
||||
europium:
|
||||
nixos-rebuild switch --flake .#europium --target-host europium --build-host europium --use-remote-sudo
|
||||
|
|
|
|||
|
|
@ -16,8 +16,13 @@
|
|||
nixos = [
|
||||
agenix.nixosModules.default
|
||||
agenix-rekey.nixosModules.default
|
||||
./modules/common
|
||||
];
|
||||
darwin = [
|
||||
agenix.darwinModules.default
|
||||
agenix-rekey.nixosModules.default
|
||||
./modules/common
|
||||
];
|
||||
darwin = [];
|
||||
};
|
||||
|
||||
# Add modules only to specific hosts
|
||||
|
|
@ -41,7 +46,7 @@
|
|||
// {
|
||||
agenix-rekey = inputs.agenix-rekey.configure {
|
||||
userFlake = inputs.self;
|
||||
nixosConfigurations = inputs.self.nixosConfigurations;
|
||||
nixosConfigurations = inputs.self.nixosConfigurations // inputs.self.darwinConfigurations;
|
||||
homeConfigurations = inputs.self.homeConfigurations;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
17
homes/x86_64-darwin/christopher@molybdenum/default.nix
Normal file
17
homes/x86_64-darwin/christopher@molybdenum/default.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
} @ all: {
|
||||
elements.secrets = {
|
||||
rekeyPath = "christopher_molybdenum";
|
||||
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHl33DPxxzxrNNjM8rL4ktAj4ExzCyGiU8rKog0csxNA";
|
||||
};
|
||||
|
||||
elements.kitty.enable = true;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
_elements.to-s3
|
||||
_elements.connect-to-mercury
|
||||
];
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
{...}: {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
window_padding_width = "5 10";
|
||||
font_family = "Monaspace Krypton";
|
||||
paste_actions = "no-op";
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
modify_font cell_height 7px
|
||||
'';
|
||||
|
||||
themeFile = "Catppuccin-Frappe";
|
||||
};
|
||||
}
|
||||
|
|
@ -32,13 +32,11 @@
|
|||
};
|
||||
};
|
||||
|
||||
elements.kitty.enable = true;
|
||||
|
||||
home = {
|
||||
extraOutputsToInstall = ["doc" "devdoc"];
|
||||
|
||||
# Until Home Manager 24.11 releases
|
||||
stateVersion = "23.11";
|
||||
enableNixpkgsReleaseCheck = false;
|
||||
|
||||
packages = with pkgs._elements; [
|
||||
quick-zeal
|
||||
spawn-term
|
||||
|
|
@ -49,7 +47,5 @@
|
|||
];
|
||||
};
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
# home.file.".config/Yubico/u2f_keys".text = "christopher:C7akk/T8XYov6fOk3rGo0ZW66QPMtdLnGznPuK+tTh/qmPecvECzGVMKJuh5M7nYsMoT6r/idAP88FGinf/rpw==,ydS/PgUALZriaaHYS81u3x8rRFulq727GDJRlvbJhP2yeKK7Ih+xqRceyabLR3MxRN8PT/MtC1I/Xjaxl0S2Rg==,es256,+presence";
|
||||
}
|
||||
|
|
|
|||
23
modules/common/default.nix
Normal file
23
modules/common/default.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
# This module is common to all systems, both nixos and darwin. It is
|
||||
# automatically added to all hosts via the flake configuration.
|
||||
|
||||
imports = [
|
||||
./elements.nix
|
||||
./secrets.nix
|
||||
./nix.nix
|
||||
|
||||
./programs/home-manager.nix
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
pre-commit
|
||||
git
|
||||
gitleaks
|
||||
just
|
||||
];
|
||||
}
|
||||
|
|
@ -4,9 +4,6 @@
|
|||
config,
|
||||
...
|
||||
}: {
|
||||
# Needed for Nix flakes
|
||||
environment.systemPackages = [pkgs.git];
|
||||
|
||||
nix.settings = {
|
||||
# auto-optimize-store = true;
|
||||
# builders-use-substitutes = true;
|
||||
0
modules/darwin/.keep
Normal file
0
modules/darwin/.keep
Normal file
|
|
@ -1,6 +0,0 @@
|
|||
{...}: {
|
||||
# Use the same secrets (agenix) module for darwin as we have already configured
|
||||
# for nixos as its functionality is not system-dependent.
|
||||
|
||||
imports = [../../nixos/secrets];
|
||||
}
|
||||
13
modules/home/common/default.nix
Normal file
13
modules/home/common/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./helix
|
||||
./terminal
|
||||
];
|
||||
|
||||
home = {
|
||||
stateVersion = "23.11";
|
||||
enableNixpkgsReleaseCheck = false;
|
||||
};
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
|
|
@ -7,8 +7,7 @@ in {
|
|||
./programs
|
||||
./shell/aliases.nix
|
||||
./shell/prompt.nix
|
||||
./shell/nu
|
||||
./shell/zsh
|
||||
# ./shell/nu
|
||||
];
|
||||
|
||||
# add environment variables
|
||||
|
|
@ -22,7 +21,6 @@ in {
|
|||
TERMINAL = "kitty";
|
||||
EDITOR = "hx";
|
||||
TERM = "xterm-color";
|
||||
# QT_QPA_PLATFORMTHEME = "qt5ct";
|
||||
|
||||
# auto-run programs using nix-index-database
|
||||
NIX_AUTO_RUN = "1";
|
||||
|
|
@ -72,12 +72,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
$env.PATH = ($env.PATH |
|
||||
split row (char esep) |
|
||||
prepend /home/myuser/.apps |
|
||||
append /usr/bin/env
|
||||
)
|
||||
|
||||
def agx [search] {
|
||||
hx (ag $search | fzf | cut -d : -f 1,2)
|
||||
}
|
||||
|
|
@ -90,6 +84,7 @@
|
|||
| append $"($env.HOME)/code/hausgold/snippets/bin"
|
||||
| append $"($env.HOME)/.bun/bin"
|
||||
| append $"($env.HOME)/.npm/bin"
|
||||
| append /usr/bin/env
|
||||
)
|
||||
'';
|
||||
};
|
||||
5
modules/home/gui/default.nix
Normal file
5
modules/home/gui/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./kitty.nix
|
||||
];
|
||||
}
|
||||
34
modules/home/gui/kitty.nix
Normal file
34
modules/home/gui/kitty.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.elements;
|
||||
in {
|
||||
options = {
|
||||
elements.kitty = {
|
||||
enable = mkEnableOption "kitty";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.kitty.enable {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
window_padding_width = "5 10";
|
||||
font_family = "Monaspace Krypton";
|
||||
paste_actions = "no-op";
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
shell ${pkgs.nushell}/bin/nu
|
||||
modify_font cell_height 7px
|
||||
'';
|
||||
|
||||
themeFile = "Catppuccin-Frappe";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
{lib, ...}: {
|
||||
documentation.dev.enable = true;
|
||||
|
||||
i18n = {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
supportedLocales = [
|
||||
|
|
|
|||
|
|
@ -1,19 +1,6 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
{...}: {
|
||||
imports = [
|
||||
./core
|
||||
./core/users.nix
|
||||
./core/nix.nix
|
||||
|
||||
./programs/home-manager.nix
|
||||
./programs/zsh.nix
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
pre-commit
|
||||
gitleaks
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
{
|
||||
environment.pathsToLink = ["/share/zsh"];
|
||||
|
||||
programs = {
|
||||
less.enable = true;
|
||||
|
||||
zsh = {
|
||||
enable = true;
|
||||
autosuggestions.enable = true;
|
||||
syntaxHighlighting = {
|
||||
enable = true;
|
||||
patterns = {
|
||||
"rm -rf *" = "fg=black,bg=red";
|
||||
};
|
||||
styles = {
|
||||
"aliases" = "fg=magenta";
|
||||
};
|
||||
highlighters = [
|
||||
"main"
|
||||
"brackets"
|
||||
"pattern"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -11,5 +11,6 @@
|
|||
};
|
||||
};
|
||||
|
||||
users.users.christopher = {}; # For some reason this is required for hm to work.
|
||||
# For some reason this is required for hm to work with nix-darwin
|
||||
users.users.christopher = {};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ with lib._elements; {
|
|||
./beszel-agent.nix
|
||||
|
||||
./wayland.nix
|
||||
|
||||
# TODO: Add config settings like "services.shutdown.enable = true;"
|
||||
"${inputs.self}/modules/nixos/common/services/shutdown.nix"
|
||||
];
|
||||
|
||||
|
|
@ -49,9 +51,6 @@ with lib._elements; {
|
|||
# Set your time zone.
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
useXkbConfig = true; # use xkbOptions in tty.
|
||||
|
|
@ -131,8 +130,6 @@ with lib._elements; {
|
|||
pinentryPackage = pkgs.pinentry-gtk2;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
|
||||
zsh.enable = true;
|
||||
};
|
||||
|
||||
environment = {
|
||||
|
|
|
|||
|
|
@ -58,15 +58,11 @@ with lib._elements; {
|
|||
gnumake
|
||||
];
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
keyMap = lib.mkForce "de";
|
||||
};
|
||||
|
||||
programs.zsh.enable = true;
|
||||
programs.vim.enable = true;
|
||||
programs.git.enable = true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue