Update and simplify the nix configuration
This commit is contained in:
parent
33cb1c5488
commit
4953bc3e75
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
result
|
22
bin/build
22
bin/build
@ -1,22 +0,0 @@
|
|||||||
#!/bin/sh -e
|
|
||||||
|
|
||||||
VERSION=1.0
|
|
||||||
export args=$@
|
|
||||||
|
|
||||||
# Navigate to the directory of this script
|
|
||||||
cd $(dirname $(readlink -f $0))
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
SYSTEM=$(uname)
|
|
||||||
|
|
||||||
build() {
|
|
||||||
if [ $SYSTEM == "Darwin" ]; then
|
|
||||||
./bin/darwin-build $args
|
|
||||||
elif [ $SYSTEM == "Linux" ]; then
|
|
||||||
./bin/nixos-build $args
|
|
||||||
else
|
|
||||||
echo "Unknown platform"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
build
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/sh -e
|
|
||||||
|
|
||||||
VERSION=1.0
|
|
||||||
|
|
||||||
GREEN='\033[1;32m'
|
|
||||||
RED='\033[1;31m'
|
|
||||||
NC='\033[0m'
|
|
||||||
|
|
||||||
FLAKE="macos"
|
|
||||||
SYSTEM="darwinConfigurations.$FLAKE.system"
|
|
||||||
|
|
||||||
export NIXPKGS_ALLOW_UNFREE=1
|
|
||||||
|
|
||||||
# Navigate to the directory of this script
|
|
||||||
cd $(dirname $(readlink -f $0))
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
echo "${GREEN}Starting build...${NC}"
|
|
||||||
nix --experimental-features 'nix-command flakes' build .#$SYSTEM $@
|
|
||||||
|
|
||||||
echo "${GREEN}Switching to new generation...${NC}"
|
|
||||||
./result/sw/bin/darwin-rebuild switch --flake .#$FLAKE $@
|
|
||||||
|
|
||||||
echo "${GREEN}Cleaning up...${NC}"
|
|
||||||
unlink ./result
|
|
||||||
|
|
||||||
echo "${GREEN}Switch to new generation complete!${NC}"
|
|
@ -1,29 +0,0 @@
|
|||||||
#!/bin/sh -e
|
|
||||||
|
|
||||||
VERSION=1.0
|
|
||||||
|
|
||||||
GREEN='\033[1;32m'
|
|
||||||
RED='\033[1;31m'
|
|
||||||
NC='\033[0m'
|
|
||||||
|
|
||||||
SYSTEM=$(uname -m)
|
|
||||||
|
|
||||||
case "$SYSTEM" in
|
|
||||||
x86_64)
|
|
||||||
FLAKE_TARGET="x86_64-linux"
|
|
||||||
;;
|
|
||||||
aarch64)
|
|
||||||
FLAKE_TARGET="aarch64-linux"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo -e "${RED}Unsupported architecture: $SYSTEM${NC}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo -e "${GREEN}Starting...${NC}"
|
|
||||||
|
|
||||||
# We pass SSH from user to root so root can download secrets from your private Github
|
|
||||||
sudo SSH_AUTH_SOCK=$SSH_AUTH_SOCK /run/current-system/sw/bin/nixos-rebuild switch --flake .#$FLAKE_TARGET $@
|
|
||||||
|
|
||||||
echo -e "${GREEN}Switch to new generation complete!${NC}"
|
|
@ -1,11 +0,0 @@
|
|||||||
|
|
||||||
## Layout
|
|
||||||
```
|
|
||||||
.
|
|
||||||
├── dock # MacOS dock configuration
|
|
||||||
├── casks.nix # List of homebrew casks
|
|
||||||
├── default.nix # Defines module, system-level config
|
|
||||||
├── files.nix # Non-Nix, static configuration files (now immutable!)
|
|
||||||
├── home-manager.nix # Defines user programs
|
|
||||||
├── packages.nix # List of packages to install for MacOS
|
|
||||||
```
|
|
@ -1,5 +1,4 @@
|
|||||||
{}:
|
{}:
|
||||||
|
|
||||||
[
|
[
|
||||||
# Development Tools
|
# Development Tools
|
||||||
"docker"
|
"docker"
|
||||||
@ -7,7 +6,6 @@
|
|||||||
"qflipper"
|
"qflipper"
|
||||||
"sublime-merge"
|
"sublime-merge"
|
||||||
"vscodium"
|
"vscodium"
|
||||||
"warp"
|
|
||||||
"zed"
|
"zed"
|
||||||
|
|
||||||
# Communication Tools
|
# Communication Tools
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
{ config, pkgs, ... }:
|
{ pkgs, user, ... }:
|
||||||
|
|
||||||
let user = "dekker1"; in
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./home-manager.nix
|
./home-manager.nix
|
||||||
@ -9,9 +6,6 @@ let user = "dekker1"; in
|
|||||||
../shared/cachix
|
../shared/cachix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Auto upgrade nix package and the daemon service.
|
|
||||||
services.nix-daemon.enable = true;
|
|
||||||
|
|
||||||
# Setup user, packages, programs
|
# Setup user, packages, programs
|
||||||
nix = {
|
nix = {
|
||||||
package = pkgs.nix;
|
package = pkgs.nix;
|
||||||
@ -34,20 +28,116 @@ let user = "dekker1"; in
|
|||||||
system.checks.verifyNixPath = false;
|
system.checks.verifyNixPath = false;
|
||||||
|
|
||||||
# Load configuration that is shared across systems
|
# Load configuration that is shared across systems
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = import ../shared/packages.nix { inherit pkgs; } ++ [
|
||||||
] ++ (import ../shared/packages.nix { inherit pkgs; });
|
# MacOS specific packages
|
||||||
|
];
|
||||||
|
|
||||||
# Setup MacOS specific services
|
# Setup MacOS specific services
|
||||||
services = {
|
services = {
|
||||||
yabai = {
|
aerospace = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraConfig = (builtins.readFile ./config/yabairc);
|
settings = {
|
||||||
|
mode.main.binding = {
|
||||||
|
# Open a new terminal window
|
||||||
|
alt-enter = "exec-and-forget /Users/dekker1/.nix-profile/bin/kitty --single-instance -d ~";
|
||||||
|
# alt-enter = "exec-and-forget open \"warp://action/new_window?path=$HOME\"";
|
||||||
|
# Toggle between floating and tiling layout
|
||||||
|
alt-shift-space = "layout floating tiling";
|
||||||
|
|
||||||
|
### Key mappings copied from the default config
|
||||||
|
# See: https://nikitabobko.github.io/AeroSpace/commands#layout
|
||||||
|
alt-slash = "layout tiles horizontal vertical";
|
||||||
|
alt-comma = "layout accordion horizontal vertical";
|
||||||
|
|
||||||
|
# See: https://nikitabobko.github.io/AeroSpace/commands#focus
|
||||||
|
alt-h = "focus left";
|
||||||
|
alt-j = "focus down";
|
||||||
|
alt-k = "focus up";
|
||||||
|
alt-l = "focus right";
|
||||||
|
|
||||||
|
# See: https://nikitabobko.github.io/AeroSpace/commands#move
|
||||||
|
alt-shift-h = "move left";
|
||||||
|
alt-shift-j = "move down";
|
||||||
|
alt-shift-k = "move up";
|
||||||
|
alt-shift-l = "move right";
|
||||||
|
|
||||||
|
# See: https://nikitabobko.github.io/AeroSpace/commands#resize
|
||||||
|
alt-shift-minus = "resize smart -50";
|
||||||
|
alt-shift-equal = "resize smart +50";
|
||||||
|
|
||||||
|
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace
|
||||||
|
alt-1 = "workspace 1";
|
||||||
|
alt-2 = "workspace 2";
|
||||||
|
alt-3 = "workspace 3";
|
||||||
|
alt-4 = "workspace 4";
|
||||||
|
alt-5 = "workspace 5";
|
||||||
|
alt-6 = "workspace 6";
|
||||||
|
alt-7 = "workspace 7";
|
||||||
|
alt-8 = "workspace 8";
|
||||||
|
alt-9 = "workspace 9";
|
||||||
|
|
||||||
|
# See: https://nikitabobko.github.io/AeroSpace/commands#move-node-to-workspace
|
||||||
|
alt-shift-1 = "move-node-to-workspace 1";
|
||||||
|
alt-shift-2 = "move-node-to-workspace 2";
|
||||||
|
alt-shift-3 = "move-node-to-workspace 3";
|
||||||
|
alt-shift-4 = "move-node-to-workspace 4";
|
||||||
|
alt-shift-5 = "move-node-to-workspace 5";
|
||||||
|
alt-shift-6 = "move-node-to-workspace 6";
|
||||||
|
alt-shift-7 = "move-node-to-workspace 7";
|
||||||
|
alt-shift-8 = "move-node-to-workspace 8";
|
||||||
|
alt-shift-9 = "move-node-to-workspace 9";
|
||||||
|
|
||||||
|
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace-back-and-forth
|
||||||
|
alt-tab = "workspace-back-and-forth";
|
||||||
|
# See: https://nikitabobko.github.io/AeroSpace/commands#move-workspace-to-monitor
|
||||||
|
alt-shift-tab = "move-workspace-to-monitor --wrap-around next";
|
||||||
|
|
||||||
|
# See: https://nikitabobko.github.io/AeroSpace/commands#mode
|
||||||
|
alt-shift-semicolon = "mode service";
|
||||||
|
};
|
||||||
|
### Service mode (from default config, with default keybindings)
|
||||||
|
mode.service.binding = {
|
||||||
|
esc = ["reload-config" "mode main"];
|
||||||
|
r = ["flatten-workspace-tree" "mode main"]; # reset layout
|
||||||
|
f = ["layout floating tiling" "mode main"]; # Toggle between floating and tiling layout
|
||||||
|
backspace = ["close-all-windows-but-current" "mode main"];
|
||||||
|
|
||||||
|
# sticky is not yet supported https://github.com/nikitabobko/AeroSpace/issues/2
|
||||||
|
#s = ["layout sticky tiling", "mode main"]
|
||||||
|
|
||||||
|
alt-shift-h = ["join-with left" "mode main"];
|
||||||
|
alt-shift-j = ["join-with down" "mode main"];
|
||||||
|
alt-shift-k = ["join-with up" "mode main"];
|
||||||
|
alt-shift-l = ["join-with right" "mode main"];
|
||||||
|
|
||||||
|
## Version 0.16+
|
||||||
|
# down = "volume down";
|
||||||
|
# up = "volume up";
|
||||||
|
# shift-down = ["volume set 0" "mode main"];
|
||||||
|
};
|
||||||
|
# on-window-detected = [
|
||||||
|
# # Use floating mode for Sublime Merge
|
||||||
|
# {
|
||||||
|
# "if.app-id" = "com.sublimemerge";
|
||||||
|
# run = "layout floating";
|
||||||
|
# }
|
||||||
|
# ];
|
||||||
|
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Auto upgrade nix package and the daemon service.
|
||||||
|
nix-daemon.enable = true;
|
||||||
|
|
||||||
skhd = {
|
skhd = {
|
||||||
enable = true;
|
enable = false;
|
||||||
skhdConfig = (builtins.readFile ./config/skhdrc);
|
skhdConfig = (builtins.readFile ./config/skhdrc);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
yabai = {
|
||||||
|
enable = false;
|
||||||
|
extraConfig = (builtins.readFile ./config/yabairc);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
system.stateVersion = 5;
|
system.stateVersion = 5;
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
{ user, config, pkgs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
xdg_configHome = "${config.users.users.${user}.home}/.config";
|
|
||||||
xdg_dataHome = "${config.users.users.${user}.home}/.local/share";
|
|
||||||
xdg_stateHome = "${config.users.users.${user}.home}/.local/state";
|
|
||||||
in
|
|
||||||
{ }
|
|
@ -1,10 +1,4 @@
|
|||||||
{ config, pkgs, lib, home-manager, ... }:
|
{ email, name, pkgs, sshSignKey, user, ... }:
|
||||||
|
|
||||||
let
|
|
||||||
user = "dekker1";
|
|
||||||
sharedFiles = import ../shared/files.nix { inherit config pkgs; };
|
|
||||||
additionalFiles = import ./files.nix { inherit user config pkgs; };
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
# It me
|
# It me
|
||||||
users.users.${user} = {
|
users.users.${user} = {
|
||||||
@ -24,6 +18,16 @@ in
|
|||||||
casks = pkgs.callPackage ./casks.nix { };
|
casks = pkgs.callPackage ./casks.nix { };
|
||||||
brews = [
|
brews = [
|
||||||
"openssl" # Required by cargo-update (`LDFLAGS="-L/usr/local/opt/openssl@3/lib" CPPFLAGS="-I/usr/local/opt/openssl@3/include" cargo install cargo-update`)
|
"openssl" # Required by cargo-update (`LDFLAGS="-L/usr/local/opt/openssl@3/lib" CPPFLAGS="-I/usr/local/opt/openssl@3/include" cargo install cargo-update`)
|
||||||
|
|
||||||
|
# MiniZinc solvers
|
||||||
|
"dekker1/minizinc/choco"
|
||||||
|
"dekker1/minizinc/flatzingo"
|
||||||
|
"dekker1/minizinc/geas"
|
||||||
|
"dekker1/minizinc/jacop"
|
||||||
|
"dekker1/minizinc/fzn-oscar-cbls"
|
||||||
|
"dekker1/minizinc/fzn-picat"
|
||||||
|
"dekker1/minizinc/pumpkin"
|
||||||
|
"dekker1/minizinc/yuck"
|
||||||
"scip"
|
"scip"
|
||||||
];
|
];
|
||||||
taps = [
|
taps = [
|
||||||
@ -58,24 +62,16 @@ in
|
|||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
users.${user} = { pkgs, config, lib, ... }: {
|
users.${user} = { pkgs, config, lib, ... }: {
|
||||||
home.enableNixpkgsReleaseCheck = false;
|
home.enableNixpkgsReleaseCheck = false;
|
||||||
home.packages = pkgs.callPackage ./packages.nix { };
|
|
||||||
home.file = lib.mkMerge [
|
|
||||||
sharedFiles
|
|
||||||
additionalFiles
|
|
||||||
];
|
|
||||||
home.stateVersion = "21.11";
|
home.stateVersion = "21.11";
|
||||||
programs = {
|
programs = lib.attrsets.recursiveUpdate (import ../shared/home-manager.nix {
|
||||||
|
inherit config email lib name pkgs sshSignKey user;
|
||||||
|
}) {
|
||||||
|
# MacOS specific home-manager program settings
|
||||||
|
git.extraConfig.gpg.ssh.program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign";
|
||||||
|
|
||||||
skim.enable = true;
|
skim.enable = true;
|
||||||
|
|
||||||
ssh.matchBlocks = {
|
ssh.matchBlocks."*".extraOptions."UseKeychain" = "yes";
|
||||||
"*" = {
|
|
||||||
extraOptions = {
|
|
||||||
"UseKeychain" = "yes";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
} // import ../shared/home-manager.nix {
|
|
||||||
inherit config pkgs lib;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
{ pkgs }:
|
|
||||||
|
|
||||||
with pkgs;
|
|
||||||
let shared-packages = import ../shared/packages.nix { inherit pkgs; }; in
|
|
||||||
shared-packages ++ [
|
|
||||||
# Encryption and security tools
|
|
||||||
pinentry_mac
|
|
||||||
]
|
|
24
flake.lock
generated
24
flake.lock
generated
@ -7,16 +7,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731153869,
|
"lastModified": 1736820923,
|
||||||
"narHash": "sha256-3Ftf9oqOypcEyyrWJ0baVkRpvQqroK/SVBFLvU3nPuc=",
|
"narHash": "sha256-SDuKLOWAh8VJRXlNWQn9QE99bjeEUAAbYXqrKGbsiyk=",
|
||||||
"owner": "LnL7",
|
"owner": "LnL7",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "5c74ab862c8070cbf6400128a1b56abb213656da",
|
"rev": "944c2b181792ae7ae6b20c0df3f44879c11706c9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "LnL7",
|
"owner": "LnL7",
|
||||||
"ref": "master",
|
"ref": "nix-darwin-24.11",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@ -28,32 +28,32 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1726989464,
|
"lastModified": 1736373539,
|
||||||
"narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
|
"narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
|
"rev": "bd65bc3cde04c16755955630b344bc9e35272c56",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"ref": "release-24.05",
|
"ref": "release-24.11",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730891215,
|
"lastModified": 1736780541,
|
||||||
"narHash": "sha256-i85DPrhDuvzgvIWCpJlbfM2UFtNYbapo20MtQXsvay4=",
|
"narHash": "sha256-6AwU5WC45Ww5q5qVR/AzKS4CeZzgOhclBKi5H7zrCnI=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c128e44a249d6180740d0a979b6480d5b795c013",
|
"rev": "31206f5a1d081808b14aef7b48f7c214d902b8c0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixpkgs-24.05-darwin",
|
"ref": "nixpkgs-24.11-darwin",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
61
flake.nix
61
flake.nix
@ -2,62 +2,53 @@
|
|||||||
description = "Dekker1's home manager configuation";
|
description = "Dekker1's home manager configuation";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-24.05-darwin";
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-24.11-darwin";
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-24.05";
|
url = "github:nix-community/home-manager/release-24.11";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
darwin = {
|
darwin = {
|
||||||
url = "github:LnL7/nix-darwin/master";
|
url = "github:LnL7/nix-darwin/nix-darwin-24.11";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
outputs =
|
outputs =
|
||||||
{ self
|
{ darwin
|
||||||
, darwin
|
|
||||||
, home-manager
|
, home-manager
|
||||||
, nixpkgs
|
, nixpkgs
|
||||||
|
, ...
|
||||||
} @ inputs:
|
} @ inputs:
|
||||||
let
|
let
|
||||||
user = "dekker1";
|
# Systems that can be used
|
||||||
linuxSystems = [ "x86_64-linux" "aarch64-linux" ];
|
linuxSystems = [ "x86_64-linux" "aarch64-linux" ];
|
||||||
darwinSystems = [ "aarch64-darwin" ];
|
darwinSystems = [ "aarch64-darwin" "x86_64-darwin" ];
|
||||||
forAllLinuxSystems = f: nixpkgs.lib.genAttrs linuxSystems (system: f system);
|
# Arguments that are passed into the system configuration
|
||||||
forAllDarwinSystems = f: nixpkgs.lib.genAttrs darwinSystems (system: f system);
|
name = "Jip J. Dekker";
|
||||||
forAllSystems = f: nixpkgs.lib.genAttrs (linuxSystems ++ darwinSystems) (system: f system);
|
email = "jip@dekker.one";
|
||||||
devShell = system:
|
sshSignKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMCC0liW47USr/Ic1rJ52V4eE07y42VG9Ols1zYBrPlc";
|
||||||
let
|
user = "dekker1";
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
# Special arguments that are passed into each system configuration
|
||||||
|
specialArgs = inputs // { inherit email name sshSignKey user; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
default = with pkgs; mkShell {
|
darwinConfigurations = nixpkgs.lib.genAttrs darwinSystems (system:
|
||||||
nativeBuildInputs = with pkgs; [ bashInteractive git ];
|
darwin.lib.darwinSystem {
|
||||||
shellHook = with pkgs; ''
|
inherit system specialArgs;
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
devShells = forAllSystems devShell;
|
|
||||||
darwinConfigurations = let user = "dekker1"; in {
|
|
||||||
macos = darwin.lib.darwinSystem {
|
|
||||||
system = "aarch64-darwin";
|
|
||||||
specialArgs = inputs;
|
|
||||||
modules = [
|
modules = [
|
||||||
home-manager.darwinModules.home-manager
|
home-manager.darwinModules.home-manager
|
||||||
./darwin
|
./darwin
|
||||||
];
|
];
|
||||||
};
|
}
|
||||||
};
|
);
|
||||||
nixosConfigurations = nixpkgs.lib.genAttrs linuxSystems (system: nixpkgs.lib.nixosSystem {
|
nixosConfigurations = nixpkgs.lib.genAttrs linuxSystems (system: nixpkgs.lib.nixosSystem {
|
||||||
system = system;
|
inherit system specialArgs;
|
||||||
specialArgs = inputs;
|
|
||||||
modules = [
|
modules = [
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager {
|
||||||
{
|
home-manager = {
|
||||||
home-manager.useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
useUserPackages = true;
|
||||||
home-manager.users.${user} = import ./nixos/home-manager.nix;
|
users.${user} = import ./nixos/home-manager.nix;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
./nixos
|
./nixos
|
||||||
];
|
];
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
## Layout
|
|
||||||
```
|
|
||||||
.
|
|
||||||
├── config # Config files not written in Nix
|
|
||||||
├── default.nix # Defines module, system-level config,
|
|
||||||
├── files.nix # Non-Nix, static configuration files (now immutable!)
|
|
||||||
├── home-manager.nix # Defines user programs
|
|
||||||
├── packages.nix # List of packages to install for NixOS
|
|
||||||
```
|
|
@ -1,9 +1,4 @@
|
|||||||
{ config, inputs, pkgs, ... }:
|
{ pkgs, user, ... }:
|
||||||
|
|
||||||
let
|
|
||||||
user = "dekker1";
|
|
||||||
keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICwXNVel0w1f4nbmu2iJsqCoeiUsENzTLyhCZjSL+jT+" ];
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../shared
|
../shared
|
||||||
@ -30,18 +25,12 @@ in
|
|||||||
"wheel" # Enable ‘sudo’ for the user.
|
"wheel" # Enable ‘sudo’ for the user.
|
||||||
];
|
];
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
openssh.authorizedKeys.keys = keys;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# My shell
|
environment.systemPackages = import ../shared/packages.nix { inherit pkgs; } ++ (with pkgs; [
|
||||||
programs.zsh.enable = true;
|
# Linux specific packages
|
||||||
|
|
||||||
fonts.packages = with pkgs; [
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
gitAndTools.gitFull
|
gitAndTools.gitFull
|
||||||
];
|
]);
|
||||||
|
|
||||||
system.stateVersion = "21.05"; # Don't change this
|
system.stateVersion = "21.05"; # Don't change this
|
||||||
|
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
{ user, pkgs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
home = builtins.getEnv "HOME";
|
|
||||||
xdg_configHome = "${home}/.config";
|
|
||||||
xdg_dataHome = "${home}/.local/share";
|
|
||||||
xdg_stateHome = "${home}/.local/state";
|
|
||||||
in
|
|
||||||
{ }
|
|
@ -1,26 +1,18 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, email, lib, name, pkgs, sshSignKey, user, ... }:
|
||||||
|
|
||||||
let
|
|
||||||
user = "dekker1";
|
|
||||||
xdg_configHome = "/home/${user}/.config";
|
|
||||||
shared-programs = import ../shared/home-manager.nix { inherit config pkgs lib; };
|
|
||||||
shared-files = import ../shared/files.nix { inherit config pkgs; };
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
home = {
|
home = {
|
||||||
enableNixpkgsReleaseCheck = false;
|
enableNixpkgsReleaseCheck = false;
|
||||||
username = "${user}";
|
username = "${user}";
|
||||||
homeDirectory = "/home/${user}";
|
homeDirectory = "/home/${user}";
|
||||||
packages = // pkgs.callPackage ./packages.nix { };
|
|
||||||
file = shared-files // import ./files.nix { inherit user; };
|
|
||||||
stateVersion = "21.05";
|
stateVersion = "21.05";
|
||||||
};
|
};
|
||||||
|
|
||||||
programs = {
|
programs = lib.attrsets.recursiveUpdate (import ../shared/home-manager.nix {
|
||||||
|
inherit config email lib name pkgs sshSignKey user;
|
||||||
|
}) {
|
||||||
firefox = {
|
firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.firefox-bin;
|
package = pkgs.firefox-bin;
|
||||||
};
|
};
|
||||||
} // shared-programs;
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
{ pkgs }:
|
|
||||||
|
|
||||||
with pkgs;
|
|
||||||
let shared-packages = import ../shared/packages.nix { inherit pkgs; }; in
|
|
||||||
shared-packages ++ [
|
|
||||||
# Encryption and security tools
|
|
||||||
pinentry
|
|
||||||
]
|
|
@ -1,6 +0,0 @@
|
|||||||
# Overlays
|
|
||||||
|
|
||||||
Files in this directory run automatically as part of each build. Some common ways I've used overlays in the past:
|
|
||||||
* Applying patches
|
|
||||||
* Downloading different versions of files (locking to a version or trying a fork)
|
|
||||||
* Workarounds and stuff I need to run temporarily
|
|
@ -1,16 +0,0 @@
|
|||||||
## Shared
|
|
||||||
Much of the code running on MacOS or NixOS is actually found here.
|
|
||||||
|
|
||||||
This configuration gets imported by both modules. Some configuration examples include `git`, `zsh`, `vim`, and `tmux`.
|
|
||||||
|
|
||||||
## Layout
|
|
||||||
```
|
|
||||||
.
|
|
||||||
├── config # Config files not written in Nix
|
|
||||||
├── cachix # Defines cachix, a global cache for builds
|
|
||||||
├── default.nix # Defines how we import overlays
|
|
||||||
├── files.nix # Non-Nix, static configuration files (now immutable!)
|
|
||||||
├── home-manager.nix # The goods; most all shared config lives here
|
|
||||||
├── packages.nix # List of packages to share
|
|
||||||
|
|
||||||
```
|
|
@ -1,4 +1,4 @@
|
|||||||
{ pkgs, lib, ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
substituters = [
|
substituters = [
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
# vim:ft=kitty
|
|
||||||
## name: Night Owl
|
|
||||||
## author: Luke Glazebrook <lukeglazebrook@hey.com>
|
|
||||||
## license: MIT
|
|
||||||
|
|
||||||
foreground #d6deeb
|
|
||||||
background #011627
|
|
||||||
selection_foreground none
|
|
||||||
selection_background #1d3b53
|
|
||||||
|
|
||||||
#: Cursor colors
|
|
||||||
cursor #80a4c2
|
|
||||||
cursor_text_color background
|
|
||||||
|
|
||||||
#: The basic 16 colors
|
|
||||||
#: black
|
|
||||||
color0 #011627
|
|
||||||
color8 #575656
|
|
||||||
|
|
||||||
#: red
|
|
||||||
color1 #ef5350
|
|
||||||
color9 #ef5350
|
|
||||||
|
|
||||||
#: green
|
|
||||||
color2 #22da6e
|
|
||||||
color10 #22da6e
|
|
||||||
|
|
||||||
#: yellow
|
|
||||||
color3 #addb67
|
|
||||||
color11 #ffeb95
|
|
||||||
|
|
||||||
#: blue
|
|
||||||
color4 #82aaff
|
|
||||||
color12 #82aaff
|
|
||||||
|
|
||||||
#: magenta
|
|
||||||
color5 #c792ea
|
|
||||||
color13 #c792ea
|
|
||||||
|
|
||||||
#: cyan
|
|
||||||
color6 #21c7a8
|
|
||||||
color14 #7fdbca
|
|
||||||
|
|
||||||
#: white
|
|
||||||
color7 #ffffff
|
|
||||||
color15 #ffffff
|
|
@ -1,7 +1,5 @@
|
|||||||
{ config, pkgs, ... }:
|
{ ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
config = {
|
config = {
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
@ -9,14 +7,5 @@
|
|||||||
allowInsecure = false;
|
allowInsecure = false;
|
||||||
allowUnsupportedSystem = true;
|
allowUnsupportedSystem = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
overlays =
|
|
||||||
# Apply each overlay found in the /overlays directory
|
|
||||||
let path = ../overlays; in with builtins;
|
|
||||||
map (n: import (path + ("/" + n)))
|
|
||||||
(filter
|
|
||||||
(n: match ".*\\.nix" n != null ||
|
|
||||||
pathExists (path + ("/" + n + "/default.nix")))
|
|
||||||
(attrNames (readDir path)));
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
{ pkgs, config, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
".config/kitty/themes/night-owl.conf" = {
|
|
||||||
text = builtins.readFile ../shared/config/kitty/night-owl.conf;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ pkgs, email, name, sshSignKey, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
name = "Jip J. Dekker";
|
|
||||||
user = "dekker1";
|
|
||||||
email = "jip@dekker.one";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
atuin.enable = true;
|
||||||
|
|
||||||
bat.enable = true;
|
bat.enable = true;
|
||||||
|
|
||||||
direnv = {
|
direnv = {
|
||||||
@ -65,30 +63,35 @@ in
|
|||||||
|
|
||||||
commit.gpgsign = true;
|
commit.gpgsign = true;
|
||||||
gpg.format = "ssh";
|
gpg.format = "ssh";
|
||||||
user.signingkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMCC0liW47USr/Ic1rJ52V4eE07y42VG9Ols1zYBrPlc";
|
user.signingkey = sshSignKey;
|
||||||
gpg.ssh.program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
jujutsu = {
|
jujutsu = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
email = "jip@dekker.one";
|
signing = {
|
||||||
name = "Jip J. Dekker";
|
sign-all = true;
|
||||||
|
backend = "ssh";
|
||||||
|
key = sshSignKey;
|
||||||
|
};
|
||||||
|
user = { inherit email name; };
|
||||||
|
ui.editor = "zed -w";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
kitty = {
|
kitty = {
|
||||||
|
darwinLaunchOptions = [ "--single-instance" ];
|
||||||
enable = true;
|
enable = true;
|
||||||
font = {
|
font = {
|
||||||
name = "JetBrainsMono Nerd Font";
|
name = "Berkeley Mono Variable Nerd Font";
|
||||||
size = 14;
|
size = 14;
|
||||||
};
|
};
|
||||||
settings = {
|
settings = {
|
||||||
cursor_shape = "underline";
|
cursor_shape = "underline";
|
||||||
confirm_os_window_close = 0;
|
confirm_os_window_close = 0;
|
||||||
};
|
};
|
||||||
theme = "GitHub Light";
|
themeFile = "Catppuccin-Latte";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Shared shell configuration
|
# Shared shell configuration
|
||||||
@ -165,19 +168,6 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# sapling = {
|
|
||||||
# enable = true;
|
|
||||||
# userName = "Jip J. Dekker";
|
|
||||||
# userEmail = "jip@dekker.one";
|
|
||||||
# extraConfig = {
|
|
||||||
# ui."ignore.userroot" = "~/.config/git/ignore";
|
|
||||||
# isl = {
|
|
||||||
# hasShownGettingStarted = false;
|
|
||||||
# render-compact = false;
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
|
|
||||||
ssh = {
|
ssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
matchBlocks = {
|
matchBlocks = {
|
||||||
@ -208,7 +198,7 @@ in
|
|||||||
settings = {
|
settings = {
|
||||||
misc.disable = [
|
misc.disable = [
|
||||||
"brew_cask"
|
"brew_cask"
|
||||||
"brew_formula"
|
# "brew_formula"
|
||||||
"containers"
|
"containers"
|
||||||
"gem"
|
"gem"
|
||||||
"node"
|
"node"
|
||||||
@ -222,7 +212,7 @@ in
|
|||||||
misc.cleanup = true;
|
misc.cleanup = true;
|
||||||
misc.no_retry = true;
|
misc.no_retry = true;
|
||||||
pre_commands = {
|
pre_commands = {
|
||||||
"Home Manager" = "(cd ~/nix-config/ && nix flake update) && ~/nix-config/bin/build";
|
"Home Manager" = "(cd ~/nix-config/ && nix flake update) && darwin-rebuild switch --flake ~/nix-config#aarch64-darwin";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -260,7 +250,6 @@ in
|
|||||||
RUSTC_WRAPPER = "sccache";
|
RUSTC_WRAPPER = "sccache";
|
||||||
};
|
};
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
|
||||||
# Load Homebrew shell environment
|
# Load Homebrew shell environment
|
||||||
if [[ -f "/opt/homebrew/bin/brew" && -x $(realpath "/opt/homebrew/bin/brew") ]]; then
|
if [[ -f "/opt/homebrew/bin/brew" && -x $(realpath "/opt/homebrew/bin/brew") ]]; then
|
||||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||||
@ -268,8 +257,5 @@ in
|
|||||||
eval "$(/usr/local/bin/brew shellenv)"
|
eval "$(/usr/local/bin/brew shellenv)"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
historySubstringSearch = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{ pkgs }:
|
{ pkgs }:
|
||||||
|
|
||||||
with pkgs; [
|
with pkgs; [
|
||||||
# General packages for development and system management
|
# General packages for development and system management
|
||||||
hut
|
hut
|
||||||
@ -35,7 +34,7 @@ with pkgs; [
|
|||||||
|
|
||||||
# Python development tools
|
# Python development tools
|
||||||
black
|
black
|
||||||
poetry
|
uv
|
||||||
|
|
||||||
# Rust development tools
|
# Rust development tools
|
||||||
rustup
|
rustup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user