1
0
Fork 0
mirror of https://github.com/tboerger/nixos-config synced 2024-05-04 16:46:06 +02:00

feat: integrate disko and more refactoring

This commit is contained in:
Thomas Boerger 2024-01-30 14:00:15 +01:00
parent 745f0e3ff3
commit 27fd4a430d
No known key found for this signature in database
GPG Key ID: F630596501026DB5
266 changed files with 6773 additions and 7306 deletions

View File

@ -14,9 +14,12 @@ execute the commands below.
Generally after the installation I'm cloning this repository somewhere onto the
desktop machine and just execute `make switch` within that repository to apply
updates, if this is not the case I can always execute
`nixos-rebuild switch --flake github:tboerger/nixos-config#name` to get the
latest changes pulled in.
updates, if this is not the case I can always execute the following command to
get the latest changes pulled in:
```console
nixos-rebuild switch --flake github:tboerger/nixos-config#hostname
```
### Anubis
@ -24,7 +27,7 @@ latest changes pulled in.
sudo loadkeys de
sudo nix-shell --packages nixUnstable
bash -c "$(curl -fsSL https://raw.githubusercontent.com/tboerger/nixos-config/master/desktops/anubis/partitions.sh)"
nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko --flake github:tboerger/nixos-config#anubis
mkdir -p /mnt/etc/ssh
cp /etc/ssh/ssh_host_* /mnt/etc/ssh/
@ -37,31 +40,24 @@ nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-confi
sudo loadkeys de
sudo nix-shell --packages nixUnstable
bash -c "$(curl -fsSL https://raw.githubusercontent.com/tboerger/nixos-config/master/desktops/chnum/partitions.sh)"
nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko --flake github:tboerger/nixos-config#chnum
mkdir -p /mnt/etc/ssh
cp /etc/ssh/ssh_host_* /mnt/etc/ssh/
nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#chnum
```
### Osiris
```console
sudo loadkeys de
sudo nix-shell --packages nixUnstable
bash -c "$(curl -fsSL https://raw.githubusercontent.com/tboerger/nixos-config/master/desktops/osiris/partitions.sh)"
mkdir -p /mnt/etc/ssh
cp /etc/ssh/ssh_host_* /mnt/etc/ssh/
nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#osiris
```
## Servers
Currently I'm applying the updates manually by cloning the repository into the
machine and executing `make switch`, but on longterm it should also just work to
use the `deploy #name` command, at least if it's executed from a NixOS desktop.
If this is not the case I can always execute the following command to get the
latest changes pulled in:
```console
nixos-rebuild switch --flake github:tboerger/nixos-config#hostname
```
### Asgard
@ -69,7 +65,7 @@ use the `deploy #name` command, at least if it's executed from a NixOS desktop.
sudo loadkeys de
sudo nix-shell --packages nixUnstable
bash -c "$(curl -fsSL https://raw.githubusercontent.com/tboerger/nixos-config/master/servers/asgard/partitions.sh)"
nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko --flake github:tboerger/nixos-config#asgard
mkdir -p /mnt/etc/ssh
cp /etc/ssh/ssh_host_* /mnt/etc/ssh/
@ -82,14 +78,27 @@ nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-confi
sudo loadkeys de
sudo nix-shell --packages nixUnstable
bash -c "$(curl -fsSL https://raw.githubusercontent.com/tboerger/nixos-config/master/servers/utgard/partitions.sh)"
nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko --flake github:tboerger/nixos-config#utgard
mkdir -p /mnt/etc/ssh
cp /etc/ssh/ssh_host_* /mnt/etc/ssh/
nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#utgard
```
### Midgard
### Vanaheim
```console
sudo loadkeys de
sudo nix-shell --packages nixUnstable
nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko --flake github:tboerger/nixos-config#vanaheim
mkdir -p /mnt/etc/ssh
cp /etc/ssh/ssh_host_* /mnt/etc/ssh/
nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#vanaheim
```
### Yggdrasil
```console
sudo loadkeys de
@ -99,7 +108,31 @@ mount /dev/disk/by-label/NIXOS_SD /mnt
mkdir -p /mnt/etc/ssh
cp /etc/ssh/ssh_host_* /mnt/etc/ssh/
nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#midgard
nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#yggdrasil
```
## Finish
Finally after I have setup the whole system I usually copy the remaining
credentials from my securely stored USB stick to get access to my SSH keys and
Gnupg keys if this is required on the machine. It should not be required for
servers.
### SSH
```console
mkdir -p ${HOME}/.ssh/
cp /media/$(whoami)/secrets/ssh/id_* ${HOME}/.ssh/
chown -R $(id -u):$(id -g) ${HOME}/.ssh
chmod u=rw,g=,o= ${HOME}/.ssh/id_*
```
### Gnupg
```console
for FILE in /media/$(whoami)/secrets/gpg/*.asc; do
gpg --import ${FILE}
done
```
## Security

View File

@ -13,7 +13,10 @@
};
kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
cleanTmpDir = true;
tmp = {
cleanOnBoot = true;
};
loader = {
efi = {
@ -36,20 +39,4 @@
kernelModules = [ "dm-snapshot" ];
};
};
services = {
thinkfan = {
enable = true;
};
};
systemd = {
services = {
thinkfan = {
preStart = "
/run/current-system/sw/bin/modprobe -r thinkpad_acpi && /run/current-system/sw/bin/modprobe thinkpad_acpi
";
};
};
};
}

View File

@ -6,19 +6,15 @@
../../shared/programs
../../shared/services
./filesystems.nix
./disko.nix
./boot.nix
./networking.nix
./graphics.nix
./hardware.nix
./extras.nix
];
personal = {
programs = {
citrix = {
enable = config.personal.programs.enable;
};
};
services = {
desktop = {
enable = config.personal.services.enable;
@ -36,9 +32,24 @@
enable = config.personal.services.enable;
};
};
programs = {
mail = {
enable = config.personal.programs.enable;
};
browser = {
enable = config.personal.programs.enable;
};
steam = {
enable = config.personal.programs.enable;
};
password = {
enable = config.personal.programs.enable;
};
};
};
system = {
stateVersion = "21.11";
stateVersion = "23.11";
};
}

93
desktops/anubis/disko.nix Normal file
View File

@ -0,0 +1,93 @@
{ ... }:
{
disko = {
devices = {
disk = {
disk1 = {
type = "disk";
device = "/dev/disk/by-id/nvme-WD_PC_SN810_SDCQNRZ-2T00-1001_22343X803590";
content = {
type = "gpt";
partitions = {
ESP = {
type = "EF00";
size = "1G";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
primary = {
size = "100%";
content = {
type = "lvm_pv";
vg = "system";
};
};
};
};
};
};
lvm_vg = {
system = {
type = "lvm_vg";
lvs = {
swap = {
size = "32G";
content = {
type = "swap";
resumeDevice = true;
};
};
root = {
size = "20G";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [
"defaults"
];
};
};
nix = {
size = "100G";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/nix";
};
};
home = {
size = "50G";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/home";
};
};
dummy1 = {
size = "1M";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/var/lib/dummy1";
};
};
};
};
};
};
};
}

View File

@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
{
services = {
thinkfan = {
enable = true;
};
};
systemd = {
services = {
thinkfan = {
preStart = "
/run/current-system/sw/bin/modprobe -r thinkpad_acpi && /run/current-system/sw/bin/modprobe thinkpad_acpi
";
};
};
};
}

View File

@ -1,39 +0,0 @@
{ config, lib, pkgs, ... }:
{
swapDevices = [{
device = "/dev/disk/by-label/swap";
}];
fileSystems."/" = {
device = "/dev/disk/by-label/root";
fsType = "ext4";
options = [
"noatime"
"discard"
];
};
fileSystems."/nix" = {
device = "/dev/disk/by-label/nix";
fsType = "ext4";
options = [
"noatime"
"discard"
];
};
fileSystems."/home" = {
device = "/dev/disk/by-label/home";
fsType = "ext4";
options = [
"noatime"
"discard"
];
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
}

View File

@ -0,0 +1,24 @@
{ config, lib, pkgs, ... }:
{
hardware = {
nvidia = {
powerManagement = {
enable = true;
};
modesetting = {
enable = true;
};
prime = {
sync = {
enable = true;
};
nvidiaBusId = "PCI:3:0:0";
intelBusId = "PCI:0:2:0";
};
};
};
}

View File

@ -14,30 +14,5 @@
updateMicrocode = lib.mkDefault true;
};
};
nvidia = {
powerManagement = {
enable = true;
};
modesetting = {
enable = true;
};
prime = {
sync = {
enable = true;
};
nvidiaBusId = "PCI:3:0:0";
intelBusId = "PCI:0:2:0";
};
};
};
services = {
xserver = {
videoDrivers = [ "nvidia" ];
};
};
}

View File

@ -1,112 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail
if [ "${EUID}" -ne 0 ]; then
echo "Please run as root"
exit 1
fi
while true; do
read -p "Are you sure you want to wipe all partitions? " awnser
case ${awnser} in
[Yy]*)
break
;;
[Nn]*)
exit
;;
*)
echo "Please answer yes or no!"
;;
esac
done
echo "----> Remove previous VGs"
vgchange -an
for VG in $(vgs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d" " -f 1); do
vgremove -y ${VG} 2>/dev/null
done
echo "----> Remove previous PVs"
for PV in $(pvs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d" " -f 1); do
pvremove -y ${PV} 2>/dev/null
done
echo "----> Drop existing partitions"
for DISK in pci-0000:02:00.0-nvme-1; do
sgdisk --zap-all /dev/disk/by-path/${DISK}
sgdisk -og /dev/disk/by-path/${DISK}
done
echo "-----> Wait for cleanup"
sleep 3
sync
echo "-----> Create sda partitions"
parted -a opt --script /dev/disk/by-path/pci-0000:02:00.0-nvme-1 \
mklabel gpt \
mkpart primary fat32 0% 1GB \
set 1 esp on \
name 1 boot \
mkpart primary 1GB 100% \
set 2 lvm on \
name 2 system
echo "-----> Reload partition table"
partprobe || true
echo "-----> Wait for partitions"
sleep 3
sync
echo "-----> Create data pv"
pvcreate /dev/disk/by-partlabel/system
echo "-----> Create data vg"
vgcreate system /dev/disk/by-partlabel/system
echo "-----> Create swap volume"
lvcreate -y --size $(cat /proc/meminfo | grep MemTotal | cut -d':' -f2 | sed 's/ //g') --name swap system
echo "-----> Create root volume"
lvcreate -y --size 20G --name root system
echo "-----> Create nix volume"
lvcreate -y --size 100G --name nix system
echo "-----> Create home volume"
lvcreate -y --size 50G --name home system
echo "-----> Enable swap partition"
mkswap -L swap /dev/system/swap
swapon /dev/system/swap
echo "-----> Create root filesystem"
mkfs.ext4 -L root /dev/system/root
echo "-----> Mount root filesystem"
mkdir -p /mnt
mount -t ext4 /dev/system/root /mnt
echo "-----> Create nix filesystem"
mkfs.ext4 -L nix /dev/system/nix
echo "-----> Mount nix filesystem"
mkdir -p /mnt/nix
mount -t ext4 /dev/system/nix /mnt/nix
echo "-----> Create home filesystem"
mkfs.ext4 -L home /dev/system/home
echo "-----> Mount home filesystem"
mkdir -p /mnt/home
mount -t ext4 /dev/system/home /mnt/home
echo "-----> Create boot filesystem"
mkfs.vfat -F32 -n boot /dev/disk/by-partlabel/boot
echo "-----> Mount boot filesystem"
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot

View File

@ -2,14 +2,21 @@
{
boot = {
supportedFilesystems = [
"ntfs"
];
binfmt = {
emulatedSystems = [
"aarch64-linux"
];
};
kernelPackages = lib.mkDefault pkgs.linuxPackages;
cleanTmpDir = true;
kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
tmp = {
cleanOnBoot = true;
};
loader = {
efi = {
@ -25,7 +32,7 @@
};
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
extraModulePackages = with config.boot.kernelPackages; [ ];
initrd = {
availableKernelModules = [ "ahci" "atkbd" "rtsx_pci_sdmmc" "sd_mod" "usb_storage" "xhci_pci" ];

View File

@ -6,19 +6,15 @@
../../shared/programs
../../shared/services
./filesystems.nix
./disko.nix
./boot.nix
./networking.nix
./graphics.nix
./hardware.nix
./extras.nix
];
personal = {
programs = {
citrix = {
enable = config.personal.programs.enable;
};
};
services = {
desktop = {
enable = config.personal.services.enable;
@ -36,9 +32,24 @@
enable = config.personal.services.enable;
};
};
programs = {
mail = {
enable = config.personal.programs.enable;
};
browser = {
enable = config.personal.programs.enable;
};
steam = {
enable = config.personal.programs.enable;
};
password = {
enable = config.personal.programs.enable;
};
};
};
system = {
stateVersion = "21.11";
stateVersion = "23.11";
};
}

93
desktops/chnum/disko.nix Normal file
View File

@ -0,0 +1,93 @@
{ ... }:
{
disko = {
devices = {
disk = {
disk1 = {
type = "disk";
device = "/dev/disk/by-id/";
content = {
type = "gpt";
partitions = {
ESK = {
type = "EF00";
size = "1G";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
primary = {
size = "100%";
content = {
type = "lvm_pv";
vg = "system";
};
};
};
};
};
};
lvm_vg = {
system = {
type = "lvm_vg";
lvs = {
swap = {
size = "32G";
content = {
type = "swap";
resumeDevice = true;
};
};
root = {
size = "20G";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [
"defaults"
];
};
};
nix = {
size = "100G";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/nix";
};
};
home = {
size = "50G";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/home";
};
};
dummy1 = {
size = "1M";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/var/lib/dummy1";
};
};
};
};
};
};
};
}

View File

@ -0,0 +1,3 @@
{ config, lib, pkgs, ... }:
{ }

View File

@ -1,39 +0,0 @@
{ config, lib, pkgs, ... }:
{
swapDevices = [{
device = "/dev/disk/by-label/swap";
}];
fileSystems."/" = {
device = "/dev/disk/by-label/root";
fsType = "ext4";
options = [
"noatime"
"discard"
];
};
fileSystems."/nix" = {
device = "/dev/disk/by-label/nix";
fsType = "ext4";
options = [
"noatime"
"discard"
];
};
fileSystems."/home" = {
device = "/dev/disk/by-label/home";
fsType = "ext4";
options = [
"noatime"
"discard"
];
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
}

View File

@ -0,0 +1,3 @@
{ config, lib, pkgs, ... }:
{ }

View File

@ -14,11 +14,5 @@
updateMicrocode = lib.mkDefault true;
};
};
video = {
hidpi = {
enable = lib.mkDefault true;
};
};
};
}

View File

@ -1,112 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail
if [ "${EUID}" -ne 0 ]; then
echo "Please run as root"
exit 1
fi
while true; do
read -p "Are you sure you want to wipe all partitions? " awnser
case ${awnser} in
[Yy]*)
break
;;
[Nn]*)
exit
;;
*)
echo "Please answer yes or no!"
;;
esac
done
echo "----> Remove previous VGs"
vgchange -an
for VG in $(vgs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d" " -f 1); do
vgremove -y ${VG} 2>/dev/null
done
echo "----> Remove previous PVs"
for PV in $(pvs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d" " -f 1); do
pvremove -y ${PV} 2>/dev/null
done
echo "----> Drop existing partitions"
for DISK in pci-0000:00:1f.2-ata-1.0; do
sgdisk --zap-all /dev/disk/by-path/${DISK}
sgdisk -og /dev/disk/by-path/${DISK}
done
echo "-----> Wait for cleanup"
sleep 3
sync
echo "-----> Create sda partitions"
parted -a opt --script /dev/disk/by-path/pci-0000:00:14.1-ata-1 \
mklabel gpt \
mkpart primary fat32 0% 1GB \
set 1 esp on \
name 1 boot \
mkpart primary 1GB 100% \
set 2 lvm on \
name 2 system
echo "-----> Reload partition table"
partprobe || true
echo "-----> Wait for partitions"
sleep 3
sync
echo "-----> Create data pv"
pvcreate /dev/disk/by-partlabel/system
echo "-----> Create data vg"
vgcreate system /dev/disk/by-partlabel/system
echo "-----> Create swap volume"
lvcreate -y --size $(cat /proc/meminfo | grep MemTotal | cut -d':' -f2 | sed 's/ //g') --name swap system
echo "-----> Create root volume"
lvcreate -y --size 20G --name root system
echo "-----> Create nix volume"
lvcreate -y --size 100G --name nix system
echo "-----> Create home volume"
lvcreate -y --size 50G --name home system
echo "-----> Enable swap partition"
mkswap -L swap /dev/system/swap
swapon /dev/system/swap
echo "-----> Create root filesystem"
mkfs.ext4 -L root /dev/system/root
echo "-----> Mount root filesystem"
mkdir -p /mnt
mount -t ext4 /dev/system/root /mnt
echo "-----> Create nix filesystem"
mkfs.ext4 -L nix /dev/system/nix
echo "-----> Mount nix filesystem"
mkdir -p /mnt/nix
mount -t ext4 /dev/system/nix /mnt/nix
echo "-----> Create home filesystem"
mkfs.ext4 -L home /dev/system/home
echo "-----> Mount home filesystem"
mkdir -p /mnt/home
mount -t ext4 /dev/system/home /mnt/home
echo "-----> Create boot filesystem"
mkfs.vfat -F32 -n boot /dev/disk/by-partlabel/boot
echo "-----> Mount boot filesystem"
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot

View File

@ -1,39 +0,0 @@
{ config, lib, pkgs, ... }:
{
swapDevices = [{
device = "/dev/disk/by-label/swap";
}];
fileSystems."/" = {
device = "/dev/disk/by-label/root";
fsType = "ext4";
options = [
"noatime"
"discard"
];
};
fileSystems."/nix" = {
device = "/dev/disk/by-label/nix";
fsType = "ext4";
options = [
"noatime"
"discard"
];
};
fileSystems."/home" = {
device = "/dev/disk/by-label/home";
fsType = "ext4";
options = [
"noatime"
"discard"
];
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
}

View File

@ -1,24 +0,0 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
hardware = {
enableAllFirmware = true;
enableRedistributableFirmware = true;
cpu = {
intel = {
updateMicrocode = lib.mkDefault true;
};
};
video = {
hidpi = {
enable = lib.mkDefault true;
};
};
};
}

View File

@ -1,11 +0,0 @@
{ config, lib, pkgs, ... }:
{
networking = {
hostName = "osiris";
networkmanager = {
enable = true;
};
};
}

View File

@ -1,112 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail
if [ "${EUID}" -ne 0 ]; then
echo "Please run as root"
exit 1
fi
while true; do
read -p "Are you sure you want to wipe all partitions? " awnser
case ${awnser} in
[Yy]*)
break
;;
[Nn]*)
exit
;;
*)
echo "Please answer yes or no!"
;;
esac
done
echo "----> Remove previous VGs"
vgchange -an
for VG in $(vgs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d" " -f 1); do
vgremove -y ${VG} 2>/dev/null
done
echo "----> Remove previous PVs"
for PV in $(pvs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d" " -f 1); do
pvremove -y ${PV} 2>/dev/null
done
echo "----> Drop existing partitions"
for DISK in pci-0000:00:1f.2-ata-1.0; do
sgdisk --zap-all /dev/disk/by-path/${DISK}
sgdisk -og /dev/disk/by-path/${DISK}
done
echo "-----> Wait for cleanup"
sleep 3
sync
echo "-----> Create sda partitions"
parted -a opt --script /dev/disk/by-path/pci-0000:00:14.1-ata-1 \
mklabel gpt \
mkpart primary fat32 0% 1GB \
set 1 esp on \
name 1 boot \
mkpart primary 1GB 100% \
set 2 lvm on \
name 2 system
echo "-----> Reload partition table"
partprobe || true
echo "-----> Wait for partitions"
sleep 3
sync
echo "-----> Create data pv"
pvcreate /dev/disk/by-partlabel/system
echo "-----> Create data vg"
vgcreate system /dev/disk/by-partlabel/system
echo "-----> Create swap volume"
lvcreate -y --size $(cat /proc/meminfo | grep MemTotal | cut -d':' -f2 | sed 's/ //g') --name swap system
echo "-----> Create root volume"
lvcreate -y --size 20G --name root system
echo "-----> Create nix volume"
lvcreate -y --size 100G --name nix system
echo "-----> Create home volume"
lvcreate -y --size 50G --name home system
echo "-----> Enable swap partition"
mkswap -L swap /dev/system/swap
swapon /dev/system/swap
echo "-----> Create root filesystem"
mkfs.ext4 -L root /dev/system/root
echo "-----> Mount root filesystem"
mkdir -p /mnt
mount -t ext4 /dev/system/root /mnt
echo "-----> Create nix filesystem"
mkfs.ext4 -L nix /dev/system/nix
echo "-----> Mount nix filesystem"
mkdir -p /mnt/nix
mount -t ext4 /dev/system/nix /mnt/nix
echo "-----> Create home filesystem"
mkfs.ext4 -L home /dev/system/home
echo "-----> Mount home filesystem"
mkdir -p /mnt/home
mount -t ext4 /dev/system/home /mnt/home
echo "-----> Create boot filesystem"
mkfs.vfat -F32 -n boot /dev/disk/by-partlabel/boot
echo "-----> Mount boot filesystem"
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot

View File

@ -3,16 +3,18 @@
"agenix": {
"inputs": {
"darwin": "darwin",
"home-manager": "home-manager",
"nixpkgs": [
"nixpkgs"
]
],
"systems": "systems"
},
"locked": {
"lastModified": 1676153903,
"narHash": "sha256-uetRyjgMiZCs6srmZ10M764Vn7F53M9mVuqnzHmyBqU=",
"lastModified": 1703433843,
"narHash": "sha256-nmtA4KqFboWxxoOAA6Y1okHbZh+HsXaMPFkYHsoDRDw=",
"owner": "ryantm",
"repo": "agenix",
"rev": "ea17cc71b4e1bc5b2601f210a1c85db9453ad723",
"rev": "417caa847f9383e111d1397039c9d4337d024bf0",
"type": "github"
},
"original": {
@ -29,11 +31,11 @@
]
},
"locked": {
"lastModified": 1673295039,
"narHash": "sha256-AsdYgE8/GPwcelGgrntlijMg4t3hLFJFCRF3tL5WVjA=",
"lastModified": 1700795494,
"narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "87b9d090ad39b25b2400029c64825fc2a8868943",
"rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d",
"type": "github"
},
"original": {
@ -43,13 +45,178 @@
"type": "github"
}
},
"deploy-rs": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": "nixpkgs",
"utils": "utils"
},
"locked": {
"lastModified": 1704875591,
"narHash": "sha256-eWRLbqRcrILgztU/m/k7CYLzETKNbv0OsT2GjkaNm8A=",
"owner": "serokell",
"repo": "deploy-rs",
"rev": "1776009f1f3fb2b5d236b84d9815f2edee463a9b",
"type": "github"
},
"original": {
"owner": "serokell",
"repo": "deploy-rs",
"type": "github"
}
},
"devshell": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1705332421,
"narHash": "sha256-USpGLPme1IuqG78JNqSaRabilwkCyHmVWY0M9vYyqEA=",
"owner": "numtide",
"repo": "devshell",
"rev": "83cb93d6d063ad290beee669f4badf9914cc16ec",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1706491084,
"narHash": "sha256-eaEv+orTmr2arXpoE4aFZQMVPOYXCBEbLgK22kOtkhs=",
"owner": "nix-community",
"repo": "disko",
"rev": "f67ba6552845ea5d7f596a24d57c33a8a9dc8de9",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1706569497,
"narHash": "sha256-oixb0IDb5eZYw6BaVr/R/1pSoMh4rfJHkVnlgeRIeZs=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "60c614008eed1d0383d21daac177a3e036192ed8",
"type": "github"
},
"original": {
"id": "flake-parts",
"type": "indirect"
}
},
"flake-utils": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1703887061,
"narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"hardware": {
"locked": {
"lastModified": 1675933606,
"narHash": "sha256-y427VhPQHOKkYvkc9MMsL/2R7M11rQxzsRdRLM3htx8=",
"lastModified": 1706182238,
"narHash": "sha256-Ti7CerGydU7xyrP/ow85lHsOpf+XMx98kQnPoQCSi1g=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "44ae00e02e8036a66c08f4decdece7e3bbbefee2",
"rev": "f84eaffc35d1a655e84749228cde19922fcf55f1",
"type": "github"
},
"original": {
@ -58,19 +225,59 @@
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"agenix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1703113217,
"narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"homeage": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1669234151,
"narHash": "sha256-TwT87E3m2TZLgwYJESlype14HxUOrRGojPM5C2akrMg=",
"owner": "jordanisaacs",
"repo": "homeage",
"rev": "02bfe4ca06962d222e522fff0240c93946b20278",
"type": "github"
},
"original": {
"owner": "jordanisaacs",
"repo": "homeage",
"type": "github"
}
},
"homemanager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
]
},
"locked": {
"lastModified": 1675935446,
"narHash": "sha256-WajulTn7QdwC7QuXRBavrANuIXE5z+08EdxdRw1qsNs=",
"lastModified": 1706473109,
"narHash": "sha256-iyuAvpKTsq2u23Cr07RcV5XlfKExrG8gRpF75hf1uVc=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2dce7f1a55e785a22d61668516df62899278c9e4",
"rev": "d634c3abafa454551f2083b054cd95c3f287be61",
"type": "github"
},
"original": {
@ -81,11 +288,77 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1676300157,
"narHash": "sha256-1HjRzfp6LOLfcj/HJHdVKWAkX9QRAouoh6AjzJiIerU=",
"lastModified": 1702272962,
"narHash": "sha256-D+zHwkwPc6oYQ4G3A1HuadopqRwUY/JkMwHz1YF7j4Q=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1703961334,
"narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1704874635,
"narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1704161960,
"narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "63143ac2c9186be6d9da6035fa22620018c85932",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1706371002,
"narHash": "sha256-dwuorKimqSYgyu8Cw6ncKhyQjUDOyuXoxDTVmAXq88s=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "545c7a31e5dedea4a6d372712a18e00ce097d462",
"rev": "c002c6aa977ad22c60398daaa9be52f2203d0006",
"type": "github"
},
"original": {
@ -95,53 +368,128 @@
"type": "github"
}
},
"nur": {
"nixpkgs_4": {
"locked": {
"lastModified": 1676443773,
"narHash": "sha256-C+hag3jz5wMKK9qNI8vfVNNZSX66X9PAtjGfNyRDCm8=",
"owner": "nix-community",
"repo": "NUR",
"rev": "26954520ec2df7d9d4137ec584412a6eb6a20f48",
"lastModified": 1704842529,
"narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_2",
"gitignore": "gitignore",
"nixpkgs": "nixpkgs_4",
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1706424699,
"narHash": "sha256-Q3RBuOpZNH2eFA1e+IHgZLAOqDD9SKhJ/sszrL8bQD4=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "7c54e08a689b53c8a1e5d70169f2ec9e2a68ffaf",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"agenix": "agenix",
"deploy-rs": "deploy-rs",
"devshell": "devshell",
"disko": "disko",
"flake-parts": "flake-parts",
"hardware": "hardware",
"homeage": "homeage",
"homemanager": "homemanager",
"nixpkgs": "nixpkgs",
"nur": "nur",
"utils": "utils_2"
"nixpkgs": "nixpkgs_3",
"pre-commit-hooks": "pre-commit-hooks"
}
},
"utils": {
"systems": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils_2": {
"systems_2": {
"locked": {
"lastModified": 1676283394,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {

380
flake.nix
View File

@ -6,16 +6,20 @@
url = "github:nixos/nixpkgs/nixos-unstable";
};
nur = {
url = "github:nix-community/NUR";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
};
utils = {
url = "github:numtide/flake-utils";
devshell = {
url = "github:numtide/devshell";
};
agenix = {
url = "github:ryantm/agenix";
deploy-rs = {
url = "github:serokell/deploy-rs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
@ -24,35 +28,38 @@
inputs.nixpkgs.follows = "nixpkgs";
};
homeage = {
url = "github:jordanisaacs/homeage";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
hardware = {
url = "github:nixos/nixos-hardware";
};
};
outputs = { self, nixpkgs, nur, utils, agenix, homemanager, hardware, ... }@inputs:
outputs = { self, nixpkgs, flake-parts, deploy-rs, disko, homemanager, homeage, agenix, hardware, ... }@inputs:
let
inherit (self) outputs;
mkComputer = configurationNix: systemName: extraModules: nixpkgs.lib.nixosSystem {
system = systemName;
modules = [
({ pkgs, ... }:
let
nur-no-pkgs = import nur {
nurpkgs = import nixpkgs { system = systemName; };
};
in
{
imports = [
nur-no-pkgs.repos.tboerger.modules
];
nixpkgs = {
overlays = [
(import ./overlays)
nur.overlay
];
};
})
}
)
homemanager.nixosModules.home-manager
agenix.nixosModules.default
configurationNix
@ -70,85 +77,322 @@
./desktops/anubis
"x86_64-linux"
[
./profiles/thomas
# ./profiles/anna
# ./profiles/adrian
# ./profiles/tabea
disko.nixosModules.disko
./home/thomas/user.nix
./home/anna/user.nix
./home/adrian/user.nix
./home/tabea/user.nix
{
home-manager = {
extraSpecialArgs = {
desktopSystem = true;
};
users = {
thomas = {
imports = [
homeage.homeManagerModules.homeage
./home/thomas
];
};
anna = {
imports = [
homeage.homeManagerModules.homeage
./home/anna
];
};
adrian = {
imports = [
homeage.homeManagerModules.homeage
./home/adrian
];
};
tabea = {
imports = [
homeage.homeManagerModules.homeage
./home/tabea
];
};
};
};
}
];
chnum = mkComputer
./desktops/chnum
"x86_64-linux"
[
./profiles/thomas
# ./profiles/anna
# ./profiles/adrian
# ./profiles/tabea
];
disko.nixosModules.disko
./home/thomas/user.nix
./home/anna/user.nix
./home/adrian/user.nix
./home/tabea/user.nix
osiris = mkComputer
./desktops/osiris
"x86_64-linux"
[
./profiles/thomas
# ./profiles/anna
# ./profiles/adrian
# ./profiles/tabea
{
home-manager = {
extraSpecialArgs = {
desktopSystem = true;
};
users = {
thomas = {
imports = [
homeage.homeManagerModules.homeage
./home/thomas
];
};
anna = {
imports = [
homeage.homeManagerModules.homeage
./home/anna
];
};
adrian = {
imports = [
homeage.homeManagerModules.homeage
./home/adrian
];
};
tabea = {
imports = [
homeage.homeManagerModules.homeage
./home/tabea
];
};
};
};
}
];
asgard = mkComputer
./servers/asgard
"x86_64-linux"
[
./profiles/thomas
# ./profiles/anna
# ./profiles/adrian
# ./profiles/tabea
disko.nixosModules.disko
./home/thomas/user.nix
{
home-manager = {
extraSpecialArgs = {
desktopSystem = false;
};
users = {
thomas = {
imports = [
homeage.homeManagerModules.homeage
./home/thomas
];
};
};
};
}
];
utgard = mkComputer
./servers/utgard
"x86_64-linux"
[
./profiles/thomas
# ./profiles/anna
# ./profiles/adrian
# ./profiles/tabea
disko.nixosModules.disko
./home/thomas/user.nix
{
home-manager = {
extraSpecialArgs = {
desktopSystem = false;
};
users = {
thomas = {
imports = [
homeage.homeManagerModules.homeage
./home/thomas
];
};
};
};
}
];
midgard = mkComputer
./servers/midgard
"aarch64-linux"
vanaheim = mkComputer
./servers/vanaheim
"x86_64-linux"
[
hardware.nixosModules.raspberry-pi-4
./profiles/thomas
# ./profiles/anna
# ./profiles/adrian
# ./profiles/tabea
disko.nixosModules.disko
./home/thomas/user.nix
{
home-manager = {
extraSpecialArgs = {
desktopSystem = false;
};
users = {
thomas = {
imports = [
homeage.homeManagerModules.homeage
./home/thomas
];
};
};
};
}
];
# yggdrasil = mkComputer
# ./servers/yggdrasil
# "aarch64-linux"
# [
# hardware.nixosModules.raspberry-pi-4
# ./home/thomas/user.nix
# {
# home-manager = {
# extraSpecialArgs = {
# desktopSystem = false;
# };
# users = {
# thomas = {
# imports = [
# homeage.homeManagerModules.homeage
# ./home/thomas
# ];
# };
# };
# };
# }
# ];
};
diskoConfigurations = {
anubis = import ./desktops/anubis/disko.nix;
chnum = import ./desktops/chnum/disko.nix;
asgard = import ./servers/asgard/disko.nix;
utgard = import ./servers/utgard/disko.nix;
vanaheim = import ./servers/vanaheim/disko.nix;
};
anubis = self.nixosConfigurations.anubis.config.system.build.toplevel;
chnum = self.nixosConfigurations.chnum.config.system.build.toplevel;
osiris = self.nixosConfigurations.osiris.config.system.build.toplevel;
asgard = self.nixosConfigurations.asgard.config.system.build.toplevel;
utgard = self.nixosConfigurations.utgard.config.system.build.toplevel;
midgard = self.nixosConfigurations.midgard.config.system.build.toplevel;
} // utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
# yggdrasil = self.nixosConfigurations.yggdrasil.config.system.build.toplevel;
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
agenix.packages.${system}.default
nixpkgs-fmt
gnumake
nixUnstable
];
deploy = {
nodes = {
asgard = {
sshOpts = [ "-p" "22" ];
hostname = "asgard.boerger.ws";
fastConnection = true;
profiles = {
system = {
sshUser = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.asgard;
user = "root";
};
};
};
utgard = {
sshOpts = [ "-p" "22" ];
hostname = "utgard.boerger.ws";
fastConnection = true;
profiles = {
system = {
sshUser = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.utgard;
user = "root";
};
};
};
vanaheim = {
sshOpts = [ "-p" "22" ];
hostname = "vanaheim.boerger.ws";
fastConnection = true;
profiles = {
system = {
sshUser = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.vanaheim;
user = "root";
};
};
};
# yggdrasil = {
# sshOpts = [ "-p" "22" ];
# hostname = "yggdrasil.boerger.ws";
# fastConnection = true;
# profiles = {
# system = {
# sshUser = "root";
# path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.yggdrasil;
# user = "root";
# };
# };
# };
};
}
);
};
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
} // flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.pre-commit-hooks.flakeModule
inputs.devshell.flakeModule
];
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem = { config, self', inputs', pkgs, system, ... }: {
pre-commit = {
check = {
enable = true;
};
};
devshells = {
default = {
commands = [
{
name = "age-encrypt";
category = "secrets commands";
help = "Encrypt secret with age";
command = "${pkgs.rage}/bin/rage -e -a -i ~/.ssh/id_ed25519";
}
{
name = "age-decrypt";
category = "secrets commands";
help = "Decrypt secret with age";
command = "${pkgs.rage}/bin/rage -d -i ~/.ssh/id_ed25519";
}
{
name = "agenix-rekey";
category = "secrets commands";
help = "Rekey agenix secrets";
command = "cd secrets && agenix -r";
}
{
package = "nixpkgs-fmt";
category = "formatter commands";
}
];
packages = with pkgs; [
agenix.packages.${system}.default
git
gnumake
home-manager
nixpkgs-fmt
nixUnstable
rage
];
};
};
};
};
}

64
home/adrian/default.nix Normal file
View File

@ -0,0 +1,64 @@
{ pkgs, lib, config, options, desktopSystem, ... }:
with lib;
let
username = "adrian";
homeDirectory = "/home/adrian";
desktop = desktopSystem;
in
{
imports = [
../shared/global
../shared/modules
./desktop
../shared/programs
./programs
../shared/services
./services
];
profile = {
desktop = {
gnome = {
enable = desktop;
};
};
programs = {
minecraft = {
enable = desktop;
};
wine = {
enable = desktop;
};
zathura = {
enable = desktop;
};
};
services = {
nextcloud = {
enable = desktop;
};
};
};
home = {
inherit username homeDirectory;
sessionVariables = {
LC_ALL = "de_DE.UTF-8";
};
file = { } // (if desktop then {
".face" = {
source = ./face.jpg;
};
} else { });
stateVersion = "23.11";
};
}

View File

@ -3,7 +3,6 @@
{
imports = [
./gnome.nix
./i3.nix
];
options = {

View File

@ -0,0 +1,76 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.desktop.gnome;
in
{
options = {
profile = {
desktop = {
gnome = {
enable = mkEnableOption "Gnome";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
gnome.adwaita-icon-theme
gnomeExtensions.espresso
];
};
dconf = {
settings = {
"org/gnome/desktop/calendar" = {
show-weekdate = true;
};
"org/gnome/desktop/input-sources" = {
sources = [ (lib.hm.gvariant.mkTuple [ "xkb" "de" ]) ];
xkb-options = [ "eurosign:e" ];
};
"org/gnome/desktop/interface" = {
clock-show-weekday = true;
show-battery-percentage = true;
};
"org/gnome/desktop/peripherals/touchpad" = {
tap-to-click = true;
two-finger-scrolling-enabled = true;
};
"org/gnome/desktop/wm/preferences" = {
button-layout = "appmenu:minimize,maximize,close";
};
"org/gnome/mutter" = {
attach-modal-dialogs = true;
dynamic-workspaces = true;
edge-tiling = true;
focus-change-on-pointer-rest = true;
workspaces-only-on-primary = true;
};
"org/gnome/shell" = {
enabled-extensions = [
"espresso@coadmunkee.github.com"
];
};
"org/gnome/shell/extensions/espresso" = {
has-battery = true;
};
"system/locale" = {
region = "de_DE.UTF-8";
};
};
};
};
}

BIN
home/adrian/face.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

25
home/adrian/user.nix Normal file
View File

@ -0,0 +1,25 @@
{ pkgs, lib, config, options, ... }:
with lib;
{
users = {
users = {
adrian = {
uid = 10002;
description = "Adrian Boerger";
shell = pkgs.zsh;
isNormalUser = true;
hashedPasswordFile = config.age.secrets."users/adrian/password".path;
extraGroups = [
"audio"
"video"
"networkmanager"
];
};
};
};
age.secrets."users/adrian/password" = {
file = ../../secrets/users/adrian/password.age;
};
}

58
home/anna/default.nix Normal file
View File

@ -0,0 +1,58 @@
{ pkgs, lib, config, options, desktopSystem, ... }:
with lib;
let
username = "anna";
homeDirectory = "/home/anna";
desktop = desktopSystem;
in
{
imports = [
../shared/global
../shared/modules
./desktop
../shared/programs
./programs
../shared/services
./services
];
profile = {
desktop = {
gnome = {
enable = desktop;
};
};
programs = {
zathura = {
enable = desktop;
};
};
services = {
nextcloud = {
enable = desktop;
};
};
};
home = {
inherit username homeDirectory;
sessionVariables = {
LC_ALL = "de_DE.UTF-8";
};
file = { } // (if desktop then {
".face" = {
source = ./face.jpg;
};
} else { });
stateVersion = "23.11";
};
}

View File

@ -1,6 +1,10 @@
{ pkgs, lib, config, options, ... }:
{
imports = [
./gnome.nix
];
options = {
profile = {
desktop = { };

View File

@ -0,0 +1,76 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.desktop.gnome;
in
{
options = {
profile = {
desktop = {
gnome = {
enable = mkEnableOption "Gnome";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
gnome.adwaita-icon-theme
gnomeExtensions.espresso
];
};
dconf = {
settings = {
"org/gnome/desktop/calendar" = {
show-weekdate = true;
};
"org/gnome/desktop/input-sources" = {
sources = [ (lib.hm.gvariant.mkTuple [ "xkb" "de" ]) ];
xkb-options = [ "eurosign:e" ];
};
"org/gnome/desktop/interface" = {
clock-show-weekday = true;
show-battery-percentage = true;
};
"org/gnome/desktop/peripherals/touchpad" = {
tap-to-click = true;
two-finger-scrolling-enabled = true;
};
"org/gnome/desktop/wm/preferences" = {
button-layout = "appmenu:minimize,maximize,close";
};
"org/gnome/mutter" = {
attach-modal-dialogs = true;
dynamic-workspaces = true;
edge-tiling = true;
focus-change-on-pointer-rest = true;
workspaces-only-on-primary = true;
};
"org/gnome/shell" = {
enabled-extensions = [
"espresso@coadmunkee.github.com"
];
};
"org/gnome/shell/extensions/espresso" = {
has-battery = true;
};
"system/locale" = {
region = "de_DE.UTF-8";
};
};
};
};
}

BIN
home/anna/face.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

25
home/anna/user.nix Normal file
View File

@ -0,0 +1,25 @@
{ pkgs, lib, config, options, ... }:
with lib;
{
users = {
users = {
anna = {
uid = 10001;
description = "Anna Boerger";
shell = pkgs.zsh;
isNormalUser = true;
hashedPasswordFile = config.age.secrets."users/anna/password".path;
extraGroups = [
"audio"
"video"
"networkmanager"
];
};
};
};
age.secrets."users/anna/password" = {
file = ../../secrets/users/anna/password.age;
};
}

View File

@ -0,0 +1,31 @@
{ pkgs, lib, config, options, ... }:
{
# nixpkgs = {
# config = {
# allowUnfree = true;
# allowUnfreePredicate = (_: true);
# };
# overlays = [
# (import ../../../overlays)
# ];
# };
homeage = {
identityPaths = [ "~/.ssh/id_ed25519" ];
installationType = "systemd";
};
programs = {
home-manager = {
enable = true;
};
};
systemd = {
user = {
startServices = "sd-switch";
};
};
}

View File

@ -0,0 +1,39 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.act;
in
{
options = {
profile = {
programs = {
act = {
enable = mkEnableOption "Act";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
act
];
};
home = {
file = {
".actrc" = {
text = ''
-P ubuntu-latest=catthehacker/ubuntu:act-latest
-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
'';
};
};
};
};
}

View File

@ -17,8 +17,8 @@ in
};
config = mkIf cfg.enable {
environment = {
systemPackages = with pkgs; [
home = {
packages = with pkgs; [
authy
];
};

View File

@ -2,24 +2,24 @@
with lib;
let
cfg = config.profile.programs.clickup;
cfg = config.profile.programs.banking;
in
{
options = {
profile = {
programs = {
clickup = {
enable = mkEnableOption "ClickUp";
banking = {
enable = mkEnableOption "Banking";
};
};
};
};
config = mkIf cfg.enable {
environment = {
systemPackages = with pkgs; [
clickup
home = {
packages = with pkgs; [
homebank
];
};
};

View File

@ -0,0 +1,29 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.clouds;
in
{
options = {
profile = {
programs = {
clouds = {
enable = mkEnableOption "Clouds";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
awscli2
azure-cli
eksctl
hcloud
];
};
};
}

View File

@ -2,33 +2,42 @@
{
imports = [
./act.nix
./authy.nix
./browser.nix
./clickup.nix
./clockify.nix
./banking.nix
./clouds.nix
./develop.nix
./dircolors.nix
./direnv.nix
./fzf.nix
./gnupg.nix
./golang.nix
./gomplate.nix
./helm.nix
./joplin.nix
./kube.nix
./lastpass.nix
./jq.nix
./jsonnet.nix
./kubectl.nix
./kustomize.nix
./latex.nix
./lens.nix
./lsd.nix
./lutris.nix
./mail.nix
./messages.nix
./minecraft.nix
./neovim.nix
./onepassword.nix
./playonlinux.nix
./network.nix
./ngrok.nix
./nodejs.nix
./office.nix
./readline.nix
./steam.nix
./shortwave.nix
./starship.nix
./terminal.nix
./terraform.nix
./tmux.nix
./wine.nix
./yed.nix
./yq.nix
./zathura.nix
];

View File

@ -0,0 +1,133 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.develop;
python310 = pkgs.python310.withPackages (p: with p; [
boto3
botocore
passlib
requests
]);
in
{
options = {
profile = {
programs = {
develop = {
enable = mkEnableOption "Develop";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
python310
ansible
ansible-lint
ansible-doctor
ansible-later
cfssl
graphviz
mediainfo
neofetch
reflex
shellcheck
silver-searcher
tldr
upx
yamllint
];
file = {
".local/bin/secrets-encrypt" = {
executable = true;
text = ''
#!/usr/bin/env bash
for FOLDER in $(find . -iname secrets -type d); do
for FILE in $(find "$FOLDER" -type f -iname \*.txt); do
echo "-> decrypting $FILE"
echo bin/vault decrypt "$FILE"
done
done
'';
};
".local/bin/secrets-decrypt" = {
executable = true;
text = ''
#!/usr/bin/env bash
for FOLDER in $(find . -iname secrets -type d); do
for FILE in $(find "$FOLDER" -type f -iname \*.txt); do
echo "-> decrypting $FILE"
echo bin/vault encrypt "$FILE"
done
done
'';
};
".local/bin/sort-requirements" = {
executable = true;
text = ''
#!${pkgs.ruby}/bin/ruby
require "yaml"
if ARGV.length != 1
puts "Usage: #{File.basename __FILE__} path/to/requirements.yml"
exit 1
end
unless File.exist? ARGV.first
puts "Error: Input file does not exist"
exit 1
end
YAML.load_file(ARGV.first).tap do |yaml|
if yaml.kind_of? Array
yaml.sort! { |a, b| a["src"] <=> b["src"] }
else
if yaml.has_key? "roles"
yaml["roles"].sort! { |a, b| a["src"] <=> b["src"] }
end
if yaml.has_key? "collections"
yaml["collections"].sort! { |a, b| a["name"] <=> b["name"] }
end
end
File.open(ARGV.first, "w+") do |file|
file.write "# Standards: 1.2\n"
if yaml.kind_of? Array
file.write yaml.to_yaml
else
result = []
if yaml.has_key? "collections"
result.push({
"collections" => yaml["collections"]
}.to_yaml)
end
if yaml.has_key? "roles"
result.push({
"roles" => yaml["roles"]
}.to_yaml)
end
file.write result.join("\n")
end
file.write "\n...\n"
end
end
'';
};
};
};
};
}

View File

@ -0,0 +1,215 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.dircolors;
in
{
options = {
profile = {
programs = {
dircolors = {
enable = mkEnableOption "Dircolors" // {
default = true;
};
};
};
};
};
config = mkIf cfg.enable {
programs = {
dircolors = {
enable = true;
enableZshIntegration = true;
settings = {
RESET = "0";
DIR = "00;38;5;33";
LINK = "01;38;5;37";
MULTIHARDLINK = "00";
FIFO = "48;5;230;38;5;136;01";
SOCK = "48;5;230;38;5;136;01";
DOOR = "48;5;230;38;5;136;01";
BLK = "48;5;230;38;5;244;01";
CHR = "48;5;230;38;5;244;01";
ORPHAN = "48;5;235;38;5;160";
MISSING = "00";
SETUID = "48;5;160;38;5;230";
SETGID = "48;5;136;38;5;230";
CAPABILITY = "30;41";
STICKY_OTHER_WRITABLE = "48;5;64;38;5;230";
OTHER_WRITABLE = "48;5;235;38;5;33";
STICKY = "48;5;33;38;5;230";
EXEC = "01;38;5;64";
".tar" = "00;38;5;61";
".tgz" = "01;38;5;61";
".arj" = "01;38;5;61";
".taz" = "01;38;5;61";
".lzh" = "01;38;5;61";
".lzma" = "01;38;5;61";
".tlz" = "01;38;5;61";
".txz" = "01;38;5;61";
".zip" = "01;38;5;61";
".zst" = "01;38;5;61";
".z" = "01;38;5;61";
".Z" = "01;38;5;61";
".dz" = "01;38;5;61";
".gz" = "01;38;5;61";
".lz" = "01;38;5;61";
".xz" = "01;38;5;61";
".bz2" = "01;38;5;61";
".bz" = "01;38;5;61";
".tbz" = "01;38;5;61";
".tbz2" = "01;38;5;61";
".tz" = "01;38;5;61";
".deb" = "01;38;5;61";
".rpm" = "01;38;5;61";
".jar" = "01;38;5;61";
".rar" = "01;38;5;61";
".ace" = "01;38;5;61";
".zoo" = "01;38;5;61";
".cpio" = "01;38;5;61";
".7z" = "01;38;5;61";
".rz" = "01;38;5;61";
".apk" = "01;38;5;61";
".gem" = "01;38;5;61";
".jpg" = "00;38;5;136";
".JPG" = "00;38;5;136";
".jpeg" = "00;38;5;136";
".gif" = "00;38;5;136";
".bmp" = "00;38;5;136";
".pbm" = "00;38;5;136";
".pgm" = "00;38;5;136";
".ppm" = "00;38;5;136";
".tga" = "00;38;5;136";
".xbm" = "00;38;5;136";
".xpm" = "00;38;5;136";
".tif" = "00;38;5;136";
".tiff" = "00;38;5;136";
".png" = "00;38;5;136";
".PNG" = "00;38;5;136";
".svg" = "00;38;5;136";
".svgz" = "00;38;5;136";
".mng" = "00;38;5;136";
".pcx" = "00;38;5;136";
".dl" = "00;38;5;136";
".xcf" = "00;38;5;136";
".xwd" = "00;38;5;136";
".yuv" = "00;38;5;136";
".cgm" = "00;38;5;136";
".emf" = "00;38;5;136";
".eps" = "00;38;5;136";
".CR2" = "00;38;5;136";
".ico" = "00;38;5;136";
".nef" = "00;38;5;136";
".NEF" = "00;38;5;136";
".webp" = "00;38;5;136";
".tex" = "01;38;5;245";
".rdf" = "01;38;5;245";
".owl" = "01;38;5;245";
".n3" = "01;38;5;245";
".ttl" = "01;38;5;245";
".nt" = "01;38;5;245";
".torrent" = "01;38;5;245";
".xml" = "01;38;5;245";
"*Makefile" = "01;38;5;245";
"*Rakefile" = "01;38;5;245";
"*Dockerfile" = "01;38;5;245";
"*build.xml" = "01;38;5;245";
"*rc" = "01;38;5;245";
"*1" = "01;38;5;245";
".nfo" = "01;38;5;245";
"*README" = "01;38;5;245";
"*README.txt" = "01;38;5;245";
"*readme.txt" = "01;38;5;245";
".md" = "01;38;5;245";
"*README.markdown" = "01;38;5;245";
".ini" = "01;38;5;245";
".yml" = "01;38;5;245";
".cfg" = "01;38;5;245";
".conf" = "01;38;5;245";
".h" = "01;38;5;245";
".hpp" = "01;38;5;245";
".c" = "01;38;5;245";
".cpp" = "01;38;5;245";
".cxx" = "01;38;5;245";
".cc" = "01;38;5;245";
".objc" = "01;38;5;245";
".sqlite" = "01;38;5;245";
".go" = "01;38;5;245";
".sql" = "01;38;5;245";
".csv" = "01;38;5;245";
".log" = "00;38;5;240";
".bak" = "00;38;5;240";
".aux" = "00;38;5;240";
".lof" = "00;38;5;240";
".lol" = "00;38;5;240";
".lot" = "00;38;5;240";
".out" = "00;38;5;240";
".toc" = "00;38;5;240";
".bbl" = "00;38;5;240";
".blg" = "00;38;5;240";
"*~" = "00;38;5;240";
"*#" = "00;38;5;240";
".part" = "00;38;5;240";
".incomplete" = "00;38;5;240";
".swp" = "00;38;5;240";
".tmp" = "00;38;5;240";
".temp" = "00;38;5;240";
".o" = "00;38;5;240";
".pyc" = "00;38;5;240";
".class" = "00;38;5;240";
".cache" = "00;38;5;240";
".aac" = "00;38;5;166";
".au" = "00;38;5;166";
".flac" = "00;38;5;166";
".mid" = "00;38;5;166";
".midi" = "00;38;5;166";
".mka" = "00;38;5;166";
".mp3" = "00;38;5;166";
".mpc" = "00;38;5;166";
".ogg" = "00;38;5;166";
".opus" = "00;38;5;166";
".ra" = "00;38;5;166";
".wav" = "00;38;5;166";
".m4a" = "00;38;5;166";
".axa" = "00;38;5;166";
".oga" = "00;38;5;166";
".spx" = "00;38;5;166";
".xspf" = "00;38;5;166";
".mov" = "01;38;5;166";
".MOV" = "01;38;5;166";
".mpg" = "01;38;5;166";
".mpeg" = "01;38;5;166";
".m2v" = "01;38;5;166";
".mkv" = "01;38;5;166";
".ogm" = "01;38;5;166";
".mp4" = "01;38;5;166";
".m4v" = "01;38;5;166";
".mp4v" = "01;38;5;166";
".vob" = "01;38;5;166";
".qt" = "01;38;5;166";
".nuv" = "01;38;5;166";
".wmv" = "01;38;5;166";
".asf" = "01;38;5;166";
".rm" = "01;38;5;166";
".rmvb" = "01;38;5;166";
".flc" = "01;38;5;166";
".avi" = "01;38;5;166";
".fli" = "01;38;5;166";
".flv" = "01;38;5;166";
".gl" = "01;38;5;166";
".m2ts" = "01;38;5;166";
".divx" = "01;38;5;166";
".webm" = "01;38;5;166";
".axv" = "01;38;5;166";
".anx" = "01;38;5;166";
".ogv" = "01;38;5;166";
".ogx" = "01;38;5;166";
};
};
};
};
}

View File

@ -19,15 +19,14 @@ in
};
config = mkIf cfg.enable {
home-manager.users."${config.profile.username}" = { config, ... }: {
programs = {
direnv = {
enable = true;
enableZshIntegration = true;
programs = {
direnv = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
nix-direnv = {
enable = true;
};
nix-direnv = {
enable = true;
};
};
};

View File

@ -19,12 +19,10 @@ in
};
config = mkIf cfg.enable {
home-manager.users."${config.profile.username}" = { config, ... }: {
programs = {
fzf = {
enable = true;
enableZshIntegration = true;
};
programs = {
fzf = {
enable = true;
enableZshIntegration = true;
};
};
};

View File

@ -0,0 +1,40 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.gnupg;
in
{
options = {
profile = {
programs = {
gnupg = {
enable = mkEnableOption "GnuPG";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
pinentry
];
};
programs = {
gpg = {
enable = true;
};
};
services = {
gpg-agent = {
enable = true;
enableSshSupport = true;
enableZshIntegration = true;
};
};
};
}

View File

@ -0,0 +1,33 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.golang;
in
{
options = {
profile = {
programs = {
golang = {
enable = mkEnableOption "Golang";
};
};
};
};
config = mkIf cfg.enable {
home = {
sessionPath = [ "$HOME/Golang/bin" ];
};
programs = {
go = {
enable = true;
package = pkgs.go;
goPath = "Golang";
goBin = "Golang/bin";
};
};
};
}

View File

@ -2,24 +2,24 @@
with lib;
let
cfg = config.profile.programs.clockify;
cfg = config.profile.programs.gomplate;
in
{
options = {
profile = {
programs = {
clockify = {
enable = mkEnableOption "Clockify";
gomplate = {
enable = mkEnableOption "Gomplate";
};
};
};
};
config = mkIf cfg.enable {
environment = {
systemPackages = with pkgs; [
clockify
home = {
packages = with pkgs; [
gomplate
];
};
};

View File

@ -0,0 +1,28 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.helm;
in
{
options = {
profile = {
programs = {
helm = {
enable = mkEnableOption "Helm";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
chart-testing
helm-docs
kubernetes-helm
];
};
};
}

View File

@ -17,8 +17,8 @@ in
};
config = mkIf cfg.enable {
environment = {
systemPackages = with pkgs; [
home = {
packages = with pkgs; [
joplin-desktop
];
};

View File

@ -2,24 +2,24 @@
with lib;
let
cfg = config.profile.programs.lastpass;
cfg = config.profile.programs.jq;
in
{
options = {
profile = {
programs = {
lastpass = {
enable = mkEnableOption "Lastpass";
jq = {
enable = mkEnableOption "Jq";
};
};
};
};
config = mkIf cfg.enable {
environment = {
systemPackages = with pkgs; [
lastpass-cli
home = {
packages = with pkgs; [
jq
];
};
};

View File

@ -0,0 +1,27 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.jsonnet;
in
{
options = {
profile = {
programs = {
jsonnet = {
enable = mkEnableOption "Jsonnet";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
go-jsonnet
jsonnet-bundler
];
};
};
}

View File

@ -0,0 +1,68 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.kubectl;
in
{
options = {
profile = {
programs = {
kubectl = {
enable = mkEnableOption "Kubectl";
};
};
};
};
config = mkIf cfg.enable {
home = {
shellAliases = {
k = "kubectl";
kunusedrs = "kubectl get replicaset -o jsonpath=\"{ .items[?(@.spec.replicas==0)].metadata.name }\"";
};
packages = with pkgs; [
argocd
clusterctl
fluxcd
grafana-loki
k9s
kind
kubectl
kubectx
kubelogin-oidc
kubevirt
stern
kubectl-get-all
kubectl-images
kubectl-ktop
kubectl-neat
kubectl-oomd
kubectl-pexec
kubectl-realname-diff
kubectl-resource-versions
kubectl-split-yaml
kubectl-view-secret
kubectl-whoami
];
file = {
".local/bin/kubectl-ctx" = {
source = "${pkgs.kubectx}/bin/kubectx";
executable = true;
};
".local/bin/kubectl-ns" = {
source = "${pkgs.kubectx}/bin/kubens";
executable = true;
};
".local/bin/kubectl-virt" = {
source = "${pkgs.kubevirt}/bin/virtctl";
executable = true;
};
};
};
};
}

View File

@ -17,14 +17,12 @@ in
};
config = mkIf cfg.enable {
home-manager.users."${config.profile.username}" = { config, ... }: {
xdg = {
configFile = {
"kustomize/plugin/viaduct.ai/v1/ksops/ksops" = {
source = "${pkgs.kustomize-sops}/lib/viaduct.ai/v1/ksops-exec/ksops-exec";
};
};
};
home = {
packages = with pkgs; [
khelm
ksops
kustomize
];
};
};
}

View File

@ -17,11 +17,9 @@ in
};
config = mkIf cfg.enable {
home-manager.users."${config.profile.username}" = { config, ... }: {
programs = {
texlive = {
enable = true;
};
programs = {
texlive = {
enable = true;
};
};
};

View File

@ -17,8 +17,8 @@ in
};
config = mkIf cfg.enable {
environment = {
systemPackages = with pkgs; [
home = {
packages = with pkgs; [
lens
];
};

View File

@ -19,12 +19,10 @@ in
};
config = mkIf cfg.enable {
home-manager.users."${config.profile.username}" = { config, ... }: {
programs = {
lsd = {
enable = true;
enableAliases = true;
};
programs = {
lsd = {
enable = true;
enableAliases = true;
};
};
};

View File

@ -17,13 +17,16 @@ in
};
config = mkIf cfg.enable {
environment = {
systemPackages = with pkgs; [
home = {
packages = with pkgs; [
discord
ferdium
mattermost-desktop
revolt-desktop
rocketchat-desktop
signal-desktop
slack
teams
teams-for-linux
];
};
};

View File

@ -17,11 +17,13 @@ in
};
config = mkIf cfg.enable {
environment = {
systemPackages = with pkgs; [
adoptopenjdk-hotspot-bin-8
home = {
packages = with pkgs; [
temurin-bin-8
temurin-bin-17
mcrcon
packwiz
ferium
prismlauncher
];
};

View File

@ -0,0 +1,157 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.neovim;
in
{
options = {
profile = {
programs = {
neovim = {
enable = mkEnableOption "Neovim" // {
default = true;
};
};
};
};
};
config = mkIf cfg.enable {
programs = {
neovim = {
enable = true;
vimAlias = true;
plugins = with pkgs.vimPlugins; [
delimitMate
dockerfile-vim
supertab
vim-airline
vim-better-whitespace
vim-easy-align
vim-nix
vim-vividchalk
];
extraConfig = ''
" filetype config {
filetype plugin on
filetype indent on
"}
" misc stuff {
set nocompatible
set modeline
set history=1000
set backspace=indent,eol,start
set selection=inclusive
set completeopt=longest,menu,preview
set diffopt+=vertical
set autoread
"}
" tab related {
set shiftwidth=2
set tabstop=2
set expandtab
set smarttab
set cindent
"}
" status related {
set ruler
set showcmd
set nonumber
set shortmess=aoOtTI
set laststatus=1
"}
" search related {
set hlsearch
set incsearch
set ignorecase
set smartcase
set scrolloff=3
set sidescrolloff=5
"}
" bell related {
set noerrorbells
set vb t_vb=
"}
" backup related {
set nobackup
"}
" swap related {
set swapfile
"}
" grep related {
set grepprg=grep\ -nH\ $*
"}
" folding related {
set foldcolumn=0
set foldmethod=indent
set foldnestmax=100
set nofoldenable
set foldlevel=1
"}
" coloring related {
set background=dark
set t_Co=256
"}
" show syntax {
syntax on
"}
" select scheme {
colorscheme vividchalk
"}
" folding mapping {
map <F5> zo
map <F6> zc
map <F7> zR
map <F8> zM
"}
" switch tabs {
map <F9> gT
map <F10> gt
"}
" past switch {
set pastetoggle=<F11>
"}
" incsearch plugin {
hi search ctermfg=red ctermbg=yellow
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
"}
" airline plugin {
let g:airline#extensions#branch#enable=1
let g:airline#extensions#modified#enable=1
let g:airline#extensions#paste#enable=1
let g:airline#extensions#whitespace#enable=1
"}
" easyalign plugin {
vmap <Enter> <Plug>(EasyAlign)
nmap <Leader>a <Plug>(EasyAlign)
vmap . <Plug>(EasyAlignRepeat)
"}
'';
};
};
};
}

View File

@ -0,0 +1,28 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.network;
in
{
options = {
profile = {
programs = {
network = {
enable = mkEnableOption "Network";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
httpie
iftop
nmap
];
};
};
}

View File

@ -0,0 +1,26 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.ngrok;
in
{
options = {
profile = {
programs = {
ngrok = {
enable = mkEnableOption "Ngrok";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
ngrok
];
};
};
}

View File

@ -0,0 +1,27 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.nodejs;
in
{
options = {
profile = {
programs = {
nodejs = {
enable = mkEnableOption "Nodejs";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
nodejs_20
yarn
];
};
};
}

View File

@ -0,0 +1,26 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.office;
in
{
options = {
profile = {
programs = {
office = {
enable = mkEnableOption "Office";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
onlyoffice-bin
];
};
};
}

View File

@ -19,15 +19,13 @@ in
};
config = mkIf cfg.enable {
home-manager.users."${config.profile.username}" = { config, ... }: {
programs = {
readline = {
enable = true;
programs = {
readline = {
enable = true;
bindings = {
"\e[5~" = "history-search-backward";
"\e[6~" = "history-search-forward";
};
bindings = {
"\e[5~" = "history-search-backward";
"\e[6~" = "history-search-forward";
};
};
};

View File

@ -0,0 +1,26 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.shortwave;
in
{
options = {
profile = {
programs = {
shortwave = {
enable = mkEnableOption "Shortwave";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
shortwave
];
};
};
}

View File

@ -0,0 +1,42 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.starship;
in
{
options = {
profile = {
programs = {
starship = {
enable = mkEnableOption "Starship" // {
default = true;
};
};
};
};
};
config = mkIf cfg.enable {
programs = {
starship = {
enable = true;
settings = {
add_newline = true;
battery = {
disabled = true;
};
directory = {
truncation_length = 5;
truncate_to_repo = false;
truncation_symbol = "/";
};
};
};
};
};
}

View File

@ -0,0 +1,26 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.terminal;
in
{
options = {
profile = {
programs = {
terminal = {
enable = mkEnableOption "Terminal";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
wezterm
];
};
};
}

View File

@ -0,0 +1,29 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.terraform;
in
{
options = {
profile = {
programs = {
terraform = {
enable = mkEnableOption "Terraform";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
terraform
terraform-docs
tflint
tfsec
];
};
};
}

View File

@ -19,15 +19,13 @@ in
};
config = mkIf cfg.enable {
home-manager.users."${config.profile.username}" = { config, ... }: {
programs = {
tmux = {
enable = true;
clock24 = true;
programs = {
tmux = {
enable = true;
clock24 = true;
tmuxinator = {
enable = true;
};
tmuxinator = {
enable = true;
};
};
};

View File

@ -17,8 +17,8 @@ in
};
config = mkIf cfg.enable {
environment = {
systemPackages = with pkgs; [
home = {
packages = with pkgs; [
winetricks
wineWowPackages.full
];

View File

@ -17,8 +17,8 @@ in
};
config = mkIf cfg.enable {
environment = {
systemPackages = with pkgs; [
home = {
packages = with pkgs; [
yed
];
};

View File

@ -0,0 +1,26 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.yq;
in
{
options = {
profile = {
programs = {
yq = {
enable = mkEnableOption "Yq";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
yq-go
];
};
};
}

View File

@ -17,11 +17,9 @@ in
};
config = mkIf cfg.enable {
home-manager.users."${config.profile.username}" = { config, ... }: {
programs = {
zathura = {
enable = true;
};
programs = {
zathura = {
enable = true;
};
};
};

View File

@ -2,12 +2,8 @@
{
imports = [
./blueman.nix
./caffeine.nix
./flameshot.nix
./mopidy.nix
./nextcloud.nix
./nmapplet.nix
./syncthing.nix
./udiskie.nix
];

View File

@ -17,11 +17,10 @@ in
};
config = mkIf cfg.enable {
home-manager.users."${config.profile.username}" = { config, ... }: {
services = {
nextcloud-client = {
enable = true;
};
services = {
nextcloud-client = {
enable = true;
startInBackground = true;
};
};
};

View File

@ -0,0 +1,26 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.services.syncthing;
in
{
options = {
profile = {
services = {
syncthing = {
enable = mkEnableOption "Syncthing";
};
};
};
};
config = mkIf cfg.enable {
services = {
syncthing = {
enable = true;
};
};
};
}

View File

@ -17,15 +17,12 @@ in
};
config = mkIf cfg.enable {
home-manager.users."${config.profile.username}" = { config, ... }: {
services = {
udiskie = {
enable = true;
automount = true;
notify = true;
};
services = {
udiskie = {
enable = true;
automount = true;
notify = true;
};
};
};
}

64
home/tabea/default.nix Normal file
View File

@ -0,0 +1,64 @@
{ pkgs, lib, config, options, desktopSystem, ... }:
with lib;
let
username = "tabea";
homeDirectory = "/home/tabea";
desktop = desktopSystem;
in
{
imports = [
../shared/global
../shared/modules
./desktop
../shared/programs
./programs
../shared/services
./services
];
profile = {
desktop = {
gnome = {
enable = desktop;
};
};
programs = {
minecraft = {
enable = desktop;
};
wine = {
enable = desktop;
};
zathura = {
enable = desktop;
};
};
services = {
nextcloud = {
enable = desktop;
};
};
};
home = {
inherit username homeDirectory;
sessionVariables = {
LC_ALL = "de_DE.UTF-8";
};
file = { } // (if desktop then {
".face" = {
source = ./face.jpg;
};
} else { });
stateVersion = "23.11";
};
}

View File

@ -1,6 +1,10 @@
{ pkgs, lib, config, options, ... }:
{
imports = [
./gnome.nix
];
options = {
profile = {
desktop = { };

View File

@ -0,0 +1,76 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.desktop.gnome;
in
{
options = {
profile = {
desktop = {
gnome = {
enable = mkEnableOption "Gnome";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
gnome.adwaita-icon-theme
gnomeExtensions.espresso
];
};
dconf = {
settings = {
"org/gnome/desktop/calendar" = {
show-weekdate = true;
};
"org/gnome/desktop/input-sources" = {
sources = [ (lib.hm.gvariant.mkTuple [ "xkb" "de" ]) ];
xkb-options = [ "eurosign:e" ];
};
"org/gnome/desktop/interface" = {
clock-show-weekday = true;
show-battery-percentage = true;
};
"org/gnome/desktop/peripherals/touchpad" = {
tap-to-click = true;
two-finger-scrolling-enabled = true;
};
"org/gnome/desktop/wm/preferences" = {
button-layout = "appmenu:minimize,maximize,close";
};
"org/gnome/mutter" = {
attach-modal-dialogs = true;
dynamic-workspaces = true;
edge-tiling = true;
focus-change-on-pointer-rest = true;
workspaces-only-on-primary = true;
};
"org/gnome/shell" = {
enabled-extensions = [
"espresso@coadmunkee.github.com"
];
};
"org/gnome/shell/extensions/espresso" = {
has-battery = true;
};
"system/locale" = {
region = "de_DE.UTF-8";
};
};
};
};
}

BIN
home/tabea/face.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

View File

@ -2,6 +2,6 @@
{
imports = [
./tailscale.nix
];
}

25
home/tabea/user.nix Normal file
View File

@ -0,0 +1,25 @@
{ pkgs, lib, config, options, ... }:
with lib;
{
users = {
users = {
tabea = {
uid = 10003;
description = "Tabea Boerger";
shell = pkgs.zsh;
isNormalUser = true;
hashedPasswordFile = config.age.secrets."users/tabea/password".path;
extraGroups = [
"audio"
"video"
"networkmanager"
];
};
};
};
age.secrets."users/tabea/password" = {
file = ../../secrets/users/tabea/password.age;
};
}

222
home/thomas/default.nix Normal file
View File

@ -0,0 +1,222 @@
{ pkgs, lib, config, options, desktopSystem, ... }:
with lib;
let
username = "thomas";
homeDirectory = "/home/thomas";
desktop = desktopSystem;
in
{
imports = [
../shared/global
../shared/modules
./desktop
../shared/programs
./programs
../shared/services
./services
];
profile = {
desktop = {
sway = {
enable = desktop;
};
};
programs = {
act = {
enable = desktop;
};
authy = {
enable = desktop;
};
banking = {
enable = desktop;
};
clouds = {
enable = desktop;
};
develop = {
enable = desktop;
};
git = {
enable = desktop;
};
github = {
enable = desktop;
};
gnupg = {
enable = desktop;
};
golang = {
enable = desktop;
};
gopass = {
enable = desktop;
};
helm = {
enable = desktop;
};
joplin = {
enable = desktop;
};
jsonnet = {
enable = desktop;
};
kubectl = {
enable = desktop;
};
kustomize = {
enable = desktop;
};
latex = {
enable = desktop;
};
lens = {
enable = desktop;
};
messages = {
enable = desktop;
};
minecraft = {
enable = desktop;
};
minio = {
enable = desktop;
};
netrc = {
enable = desktop;
};
ngrok = {
enable = desktop;
};
nodejs = {
enable = desktop;
};
office = {
enable = desktop;
};
shortwave = {
enable = desktop;
};
ssh = {
enable = desktop;
};
terminal = {
enable = desktop;
};
terraform = {
enable = desktop;
};
vscode = {
enable = desktop;
};
wine = {
enable = desktop;
};
yed = {
enable = desktop;
};
zathura = {
enable = desktop;
};
jq = {
enable = true;
};
network = {
enable = true;
};
yq = {
enable = true;
};
};
services = {
nextcloud = {
enable = desktop;
};
udiskie = {
enable = desktop;
};
syncthing = {
enable = desktop;
};
};
};
home = {
inherit username homeDirectory;
sessionPath = [ "$HOME/.local/bin" ];
sessionVariables = {
LC_ALL = "en_US.UTF-8";
};
file = {
".local/bin/git-gh-pages" = {
executable = true;
source = ./scripts/git-gh-pages.sh;
};
".local/bin/git-promote" = {
executable = true;
source = ./scripts/git-promote.sh;
};
".local/bin/search-and-replace" = {
executable = true;
source = ./scripts/search-and-replace.sh;
};
".local/bin/each-dir" = {
executable = true;
source = ./scripts/each-dir.sh;
};
} // (if desktop then {
".local/bin/secrets-encrypt" = {
executable = true;
text = ''
#!/usr/bin/env bash
for FOLDER in $(find . -iname secrets -type d); do
for FILE in $(find $FOLDER -type f -iname \*.txt); do
echo "-> encrypting $FILE"
echo bin/vault encrypt $FILE
done
done
'';
};
".local/bin/secrets-decrypt" = {
executable = true;
text = ''
#!/usr/bin/env bash
for FOLDER in $(find . -iname secrets -type d); do
for FILE in $(find $FOLDER -type f -iname \*.txt); do
echo "-> decrypting $FILE"
echo bin/vault decrypt $FILE
done
done
'';
};
".wallpapers/dark.jpg" = {
source = ./wallpapers/dark.jpg;
};
".wallpapers/light.jpg" = {
source = ./wallpapers/light.jpg;
};
".wallpapers/tower.jpg" = {
source = ./wallpapers/tower.jpg;
};
".face" = {
source = ./face.jpg;
};
} else { });
stateVersion = "23.11";
};
}

View File

@ -1,6 +1,12 @@
{ pkgs, lib, config, options, ... }:
{
imports = [
./gnome.nix
./i3.nix
./sway.nix
];
options = {
profile = {
desktop = { };

View File

@ -0,0 +1,231 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.desktop.gnome;
in
{
options = {
profile = {
desktop = {
gnome = {
enable = mkEnableOption "Gnome";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
xclip
gnomeExtensions.alphabetical-app-grid
gnomeExtensions.app-icons-taskbar
gnomeExtensions.auto-move-windows
gnomeExtensions.calc
gnomeExtensions.clipboard-indicator
gnomeExtensions.custom-hot-corners-extended
gnomeExtensions.espresso
gnomeExtensions.gtile
gnomeExtensions.removable-drive-menu
gnomeExtensions.tailscale-status
gnomeExtensions.tray-icons-reloaded
gnomeExtensions.vitals
# gnomeExtensions.appindicator
];
};
programs = { };
services = { };
dconf = {
settings = {
"org/gnome/desktop/input-sources" = {
sources = [ (lib.hm.gvariant.mkTuple [ "xkb" "de" ]) ];
xkb-options = [ "eurosign:e" ];
};
"org/gnome/desktop/calendar" = {
show-weekdate = true;
};
"org/gnome/desktop/interface" = {
clock-show-weekday = true;
show-battery-percentage = true;
};
"org/gnome/desktop/peripherals/touchpad" = {
tap-to-click = true;
two-finger-scrolling-enabled = true;
};
"org/gnome/desktop/wm/preferences" = {
button-layout = "appmenu:minimize,maximize,close";
};
"org/gnome/desktop/background" = {
color-shading-type = "solid";
picture-options = "zoom";
picture-uri = "file://${config.home.homeDirectory}/.wallpapers/tower.jpg";
picture-uri-dark = "file://${home.homedirectory}/.wallpapers/tower.jpg";
show-desktop-icons = true;
};
"org/gnome/desktop/screensaver" = {
color-shading-type = "solid";
picture-options = "zoom";
picture-uri = "file://${config.home.homeDirectory}/.wallpapers/tower.jpg";
picture-uri-dark = "file://${home.homedirectory}/.wallpapers/tower.jpg";
lock-delay = mkUint32 0;
};
"org/gnome/desktop/notifications" = {
show-in-lock-screen = false;
};
"org/gnome/desktop/privacy" = {
old-files-age = mkUint32 1;
remember-recent-files = false;
remove-old-temp-files = true;
remove-old-trash-files = true;
report-technical-problems = false;
};
"org/gnome/settings-daemon/peripherals/touchpad" = {
natural-scroll = true;
disable-while-typing = false;
tap-to-click = true;
touchpad-enabled = true;
};
"org/gnome/mutter" = {
attach-modal-dialogs = true;
dynamic-workspaces = true;
edge-tiling = true;
focus-change-on-pointer-rest = true;
workspaces-only-on-primary = true;
};
"org/gnome/shell" = {
favorite-apps = [
"org.gnome.Calendar.desktop"
"org.gnome.Nautilus.desktop"
];
enabled-extensions = with pkgs; [
gnomeExtensions.alphabetical-app-grid.uuid # AlphabeticalAppGrid@stuarthayhurst
gnomeExtensions.app-icons-taskbar.uuid # "aztaskbar@aztaskbar.gitlab.com"
gnomeExtensions.auto-move-windows.uuid # "auto-move-windows@gnome-shell-extensions.gcampax.github.com"
gnomeExtensions.calc.uuid # "calc@danigm.wadobo.com"
gnomeExtensions.clipboard-indicator # "clipboard-indicator@tudmotu.com"
gnomeExtensions.custom-hot-corners-extended.uuid # "custom-hot-corners-extended@G-dH.github.com"
gnomeExtensions.espresso.uuid # "espresso@coadmunkee.github.com"
gnomeExtensions.gtile.uuid # "gTile@vibou"
gnomeExtensions.removable-drive-menu.uuid # "drive-menu@gnome-shell-extensions.gcampax.github.com"
gnomeExtensions.tailscale-status.uuid # "tailscale-status@maxgallup.github.com"
gnomeExtensions.tray-icons-reloaded.uuid # "trayIconsReloaded@selfmade.pl"
gnomeExtensions.vitals # "Vitals@CoreCoding.com"
# gnomeExtensions.appindicator.uuid # "appindicatorsupport@rgcjonas.gmail.com"
];
};
"org/gnome/shell/extensions/custom-hot-corners-extended/misc" = {
show-osd-monitor-indexes = false;
};
"org/gnome/shell/extensions/custom-hot-corners-extended/monitor-0-bottom-left-0" = {
action = "show-desktop";
};
"org/gnome/shell/extensions/custom-hot-corners-extended/monitor-0-bottom-right-0" = {
action = "show-desktop";
};
"org/gnome/shell/extensions/custom-hot-corners-extended/monitor-0-top-left-0" = {
action = "toggle-overview";
};
"org/gnome/shell/extensions/custom-hot-corners-extended/monitor-0-top-right-0" = {
action = "toggle-overview";
};
"org/gnome/shell/extensions/custom-hot-corners-extended/monitor-1-bottom-left-0" = {
action = "show-desktop";
};
"org/gnome/shell/extensions/custom-hot-corners-extended/monitor-1-bottom-right-0" = {
action = "show-desktop";
};
"org/gnome/shell/extensions/custom-hot-corners-extended/monitor-1-top-left-0" = {
action = "toggle-overview";
};
"org/gnome/shell/extensions/custom-hot-corners-extended/monitor-1-top-right-0" = {
action = "toggle-overview";
};
"org/gnome/shell/extensions/custom-hot-corners-extended/monitor-2-bottom-left-0" = {
action = "show-desktop";
};
"org/gnome/shell/extensions/custom-hot-corners-extended/monitor-2-bottom-right-0" = {
action = "show-desktop";
};
"org/gnome/shell/extensions/custom-hot-corners-extended/monitor-2-top-left-0" = {
action = "toggle-overview";
};
"org/gnome/shell/extensions/custom-hot-corners-extended/monitor-2-top-right-0" = {
action = "toggle-overview";
};
"org/gnome/shell/extensions/custom-hot-corners-extended/monitor-3-bottom-left-0" = {
action = "show-desktop";
};
"org/gnome/shell/extensions/custom-hot-corners-extended/monitor-3-bottom-right-0" = {
action = "show-desktop";
};
"org/gnome/shell/extensions/custom-hot-corners-extended/monitor-3-top-left-0" = {
action = "toggle-overview";
};
"org/gnome/shell/extensions/custom-hot-corners-extended/monitor-3-top-right-0" = {
action = "toggle-overview";
};
"org/gnome/shell/extensions/aztaskbar" = {
main-panel-height = (lib.hm.gvariant.mkTuple [ true 40 ]);
show-apps-button = (lib.hm.gvariant.mkTuple [ true 0 ]);
};
"org/gnome/shell/extensions/espresso" = {
has-battery = true;
};
"org/gnome/shell/extensions/vitals" = {
show-fan = true;
show-storage = false;
show-temperature = true;
show-voltage = true;
};
"org/gnome/shell/weather" = {
automatic-location = true;
};
"system/locale" = {
region = "de_DE.UTF-8";
};
};
};
};
}

611
home/thomas/desktop/i3.nix Normal file
View File

@ -0,0 +1,611 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.desktop.i3;
programs = {
term = [
{
exec = "wezterm";
class = "WezTerm";
}
];
editor = [
{
exec = "code";
class = "code";
}
];
browser = [
{
exec = "google-chrome-stable";
class = "google-chrome";
}
];
music = [
{
exec = "shortwave";
class = "shortwave";
}
];
mail = [
{
exec = "mailspring";
class = "mailspring";
}
];
chat = [ ];
};
in
{
options = {
profile = {
desktop = {
i3 = {
enable = mkEnableOption "i3";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
scrot
xclip
];
};
programs = {
feh = {
enable = true;
};
autorandr = {
enable = true;
};
rofi = {
enable = true;
font = "DejaVu Sans Mono 14";
terminal = "wezterm";
theme = "solarized";
plugins = with pkgs; [
rofi-calc
rofi-file-browser
rofi-power-menu
rofi-pulse-select
rofi-systemd
rofi-vpn
];
extraConfig = {
modi = "window,drun,ssh";
};
};
};
services = {
gnome-keyring = {
enable = true;
};
caffeine = {
enable = true;
};
blueman-applet = {
enable = true;
};
clipman = {
enable = true;
};
network-manager-applet = {
enable = true;
};
playerctld = {
enable = true;
};
flameshot = {
enable = true;
};
autorandr = {
enable = true;
};
betterlockscreen = {
enable = true;
arguments = [ "--update ${home.homeDirectory}/.wallpapers/tower.jpg" ];
};
dunst = {
enable = true;
iconTheme = {
name = "Numix";
package = pkgs.numix-icon-theme;
size = "64x64";
};
settings = {
global = {
font = "DejaVu Sans Mono 14";
frame_color = "#93a1a1";
separator_color = "#93a1a1";
};
urgency_normal = {
msg_urgency = "normal";
background = "#586e75";
foreground = "#93a1a1";
};
urgency_critical = {
msg_urgency = "critical";
background = "#dc322f";
foreground = "#eee8d5";
};
urgency_low = {
msg_urgency = "low";
background = "#073642";
foreground = "#657b83";
};
};
};
polybar = {
enable = true;
script = "polybar general &";
package = pkgs.polybar.override {
i3Support = true;
mpdSupport = true;
iwSupport = true;
pulseSupport = true;
githubSupport = true;
};
settings =
let
icons = {
powerOff = "";
xmark = "";
microchip = "";
memory = "";
batteryBolt = "";
batteryHalf = "";
batteryFull = "";
batteryExclamation = "";
volumeHigh = "";
volumeSlash = "";
wifi = "";
wifiSlash = "";
ethernet = "";
calendar = "";
clock = "";
terminal = "";
code = "";
chrome = "";
envelope = "";
music = "";
comment = "";
question = "?";
};
fonts = {
font-0 = "DejaVu Sans Mono:size=14:style=Regular;0";
font-1 = "Font Awesome 6 Free Solid:size=12:style=Solid;-1";
font-2 = "FontAwesome:size=12:style=Regular;-2";
};
in
{
"colors" = {
background = "#002b36";
background-alt = "#073642";
foreground = "#93a1a1";
foreground-alt = "#eee8d5";
primary = "#ffb52a";
secondary = "#e60053";
alert = "#bd2c40";
red = "#dc322f";
};
"bar/general" = fonts // {
width = "100%";
height = 43;
radius = 0;
fixed-center = true;
background = "\${colors.background}";
foreground = "\${colors.foreground}";
line-size = 3;
line-color = "#f00";
border-size = 5;
border-color = "#000000";
padding-left = 0;
padding-right = 2;
module-margin-left = 2;
module-margin-right = 2;
modules-left = "i3";
modules-center = "";
modules-right = "cpu memory volume wireless wired battery date";
tray-position = "right";
tray-padding = 2;
tray-background = "#0063ff";
wm-restack = "i3";
scroll-up = "i3wm-wsnext";
scroll-down = "i3wm-wsprev";
};
"module/i3" = {
type = "internal/i3";
strip-wsnumbers = true;
ws-icon-0 = "1;${icons.terminal}";
ws-icon-1 = "2;${icons.code}";
ws-icon-2 = "3;${icons.chrome}";
ws-icon-3 = "4;${icons.envelope}";
ws-icon-4 = "5;${icons.music}";
ws-icon-5 = "6;${icons.comment}";
ws-icon-6 = "7:${icons.question}";
ws-icon-7 = "8:${icons.question}";
ws-icon-8 = "9:${icons.question}";
ws-icon-default = "${icons.question}";
label-mode = "%mode%";
label-mode-padding = 2;
label-mode-underline = "\${colors.foreground}";
# label-mode-background = "#e60053";
label-focused = "%icon%";
label-focused-padding = 4;
label-focused-underline = "\${colors.foreground}";
# label-focused-foreground = "#ffffff";
# label-focused-background = "#3f3f3f";
label-unfocused = "%icon%";
label-unfocused-padding = 4;
label-unfocused-underline = "\${colors.foreground}";
label-visible = "%icon%";
label-visible-padding = 4;
label-visible-underline = "\${colors.foreground}";
label-urgent = "%icon%";
label-urgent-padding = 4;
label-urgent-underline = "\${colors.foreground}";
# label-urgent-foreground = "#000000";
# label-urgent-background = "#bd2c40";
label-separator = "";
label-separator-padding = 0;
label-separator-underline = "\${colors.foreground}";
# label-separator-foreground = "#ffb52a";
};
"module/cpu" = {
type = "internal/cpu";
format = "${icons.microchip} <label>";
format-underline = "\${colors.foreground}";
label = "%percentage%%";
label-warn = "%percentage%%";
};
"module/memory" = {
type = "internal/memory";
format = "${icons.memory} <label>";
format-underline = "\${colors.foreground}";
label = "%percentage_used%%";
label-warn = "%percentage_used%%";
};
"module/volume" = {
type = "internal/pulseaudio";
use-ui-max = true;
format-volume = "${icons.volumeHigh} <label-volume>";
format-volume-underline = "\${colors.foreground}";
label-volume = "%percentage%%";
format-muted = "${icons.volumeHigh} <label-muted>";
format-muted-underline = "\${colors.secondary}";
label-muted = "%percentage%%";
};
"module/wireless" = {
type = "internal/network";
interface = "wlp2s0";
interface-type = "wireless";
format-connected = "${icons.wifi} <label-connected>";
format-connected-underline = "\${colors.foreground}";
label-connected = "%signal%%";
format-disconnected = "${icons.wifiSlash} <label-disconnected>";
format-disconnected-underline = "\${colors.secondary}";
label-disconnected = "N/A";
};
"module/wired" = {
type = "internal/network";
interface = "enp0s25";
interface-type = "wired";
format-connected = "${icons.ethernet} <label-connected>";
format-connected-underline = "\${colors.foreground}";
label-connected = "%ifname%";
format-disconnected = "${icons.ethernet} <label-disconnected>";
format-disconnected-underline = "\${colors.secondary}";
label-disconnected = "N/A";
};
"module/battery" = {
type = "internal/battery";
full-at = 98;
low-at = 10;
battery = "CMB1";
adapter = "ADP1";
format-full = "${icons.batteryFull} <label-full>";
format-full-underline = "\${colors.foreground}";
label-full = "%percentage%%";
format-charging = "${icons.batteryBolt} <label-charging>";
format-charging-underline = "\${colors.foreground}";
label-charging = "%percentage%%";
format-discharging = "${icons.batteryHalf} <label-discharging>";
format-discharging-underline = "\${colors.foreground}";
label-discharging = "%percentage%%";
format-low = "${icons.batteryExclamation} <label-low>";
format-low-underline = "\${colors.secondary}";
label-low = "%percentage%%";
};
"module/date" = {
type = "internal/date";
date = "";
date-alt = "${icons.calendar} %Y-%m-%d ";
time = "${icons.clock} %H:%M";
time-alt = "${icons.clock} %H:%M:%S";
format-prefix = "";
format-prefix-foreground = "\${colors.foreground-alt}";
format-underline = "\${colors.foreground}";
label = "%date%%time%";
};
};
};
};
xsession = {
windowManager = {
i3 = {
enable = true;
package = pkgs.i3-gaps;
config = {
terminal = "${pkgs.wezterm}/bin/wezterm";
bars = mkDefault [ ];
modes = mkDefault { };
fonts = {
size = 14.0;
names = [
"DejaVu Sans Mono"
];
};
floating = {
modifier = "Mod4";
};
assigns = {
"1" = map (i: { class = i.class; }) programs.term;
"2" = map (i: { class = i.class; }) programs.editor;
"3" = map (i: { class = i.class; }) programs.browser;
"4" = map (i: { class = i.class; }) programs.mail;
"5" = map (i: { class = i.class; }) programs.music;
"6" = map (i: { class = i.class; }) programs.chat;
};
startup = [
{
command = "feh --no-fehbg --bg-scale ${home.homeDirectory}/.wallpapers/tower.jpg";
always = false;
notification = false;
}
{
command = "systemctl --user restart polybar";
always = true;
notification = false;
}
{
command = "systemctl --user restart dunst";
always = true;
notification = false;
}
{
command = "systemctl --user restart udiskie";
always = true;
notification = false;
}
{
command = "systemctl --user restart nm-applet";
always = true;
notification = false;
}
{
command = "systemctl --user restart blueman-applet";
always = true;
notification = false;
}
] ++ (map (i: { command = i.exec; notification = false; }) programs.term) ++ (map (i: { command = i.exec; notification = false; }) programs.editor) ++ (map (i: { command = i.exec; notification = false; }) programs.browser) ++ (map (i: { command = i.exec; notification = false; }) programs.mail) ++ (map (i: { command = i.exec; notification = false; }) programs.music) ++ (map (i: { command = i.exec; notification = false; }) programs.chat);
gaps = {
smartGaps = true;
inner = 12;
};
colors = {
focused = {
border = "#002b36";
background = "#586e75";
text = "#fdf6e3";
indicator = "#268bd2";
childBorder = "#586e75";
};
focusedInactive = {
border = "#002b36";
background = "#073642";
text = "#839496";
indicator = "#073642";
childBorder = "#073642";
};
unfocused = {
border = "#002b36";
background = "#073642";
text = "#839496";
indicator = "#073642";
childBorder = "#073642";
};
urgent = {
border = "#002b36";
background = "#dc322f";
text = "#fdf6e3";
indicator = "#002b36";
childBorder = "#dc322f";
};
};
keybindings = {
"XF86AudioPlay" = "exec --no-startup-id playerctl play-pause";
"XF86AudioPrev" = "exec --no-startup-id playerctl previous";
"XF86AudioNext" = "exec --no-startup-id playerctl next";
"XF86AudioStop" = "exec --no-startup-id playerctl stop";
"XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%";
"XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle";
"XF86MonBrightnessUp" = "exec --no-startup-id ${pkgs.light}/bin/light -A 5";
"XF86MonBrightnessDown" = "exec --no-startup-id ${pkgs.light}/bin/light -U 5";
"--release Print" = "exec --no-startup-id ${pkgs.scrot}/bin/scrot";
"--release Shift+Print" = "exec --no-startup-id ${pkgs.scrot}/bin/scrot -u";
"--release Ctrl+Print" = "exec --no-startup-id ${pkgs.scrot}/bin/scrot -s";
"Mod4+d" = "exec --no-startup-id ${pkgs.rofi}/bin/rofi -show drun";
"Mod4+Return" = "exec ${pkgs.wezterm}/bin/wezterm";
"Mod4+Shift+q" = "kill";
"Mod4+Left" = "focus left";
"Mod4+Down" = "focus down";
"Mod4+Up" = "focus up";
"Mod4+Right" = "focus right";
"Mod4+Shift+Left" = "move left";
"Mod4+Shift+Down" = "move down";
"Mod4+Shift+Up" = "move up";
"Mod4+Shift+Right" = "move right";
"Mod4+h" = "split h";
"Mod4+v" = "split v";
"Mod4+f" = "fullscreen toggle";
"Mod4+s" = "layout stacking";
"Mod4+w" = "layout tabbed";
"Mod4+e" = "layout toggle split";
"Mod4+Shift+Space" = "floating toggle";
"Mod4+Space" = "focus mode_toggle";
"Mod4+1" = "workspace number 1";
"Mod4+2" = "workspace number 2";
"Mod4+3" = "workspace number 3";
"Mod4+4" = "workspace number 4";
"Mod4+5" = "workspace number 5";
"Mod4+6" = "workspace number 6";
"Mod4+7" = "workspace number 7";
"Mod4+8" = "workspace number 8";
"Mod4+9" = "workspace number 9";
"Mod4+Shift+1" = "move container to workspace number 1";
"Mod4+Shift+2" = "move container to workspace number 2";
"Mod4+Shift+3" = "move container to workspace number 3";
"Mod4+Shift+4" = "move container to workspace number 4";
"Mod4+Shift+5" = "move container to workspace number 5";
"Mod4+Shift+6" = "move container to workspace number 6";
"Mod4+Shift+7" = "move container to workspace number 7";
"Mod4+Shift+8" = "move container to workspace number 8";
"Mod4+Shift+9" = "move container to workspace number 9";
"Mod4+Shift+c" = "reload";
"Mod4+Shift+r" = "restart";
};
};
extraConfig = ''
set $power "[l]ock log[o]ut [s]uspend [h]ibernate [r]eboot [p]oweroff"
mode $power {
bindsym l exec ${pkgs.betterlockscreen}/bin/betterlockscreen --lock dim; mode "default"
bindsym o exec i3-msg exit; mode "default"
bindsym s exec systemctl suspend; mode "default"
bindsym h exec systemctl hibernate; mode "default"
bindsym r exec systemctl reboot; mode "default"
bindsym p exec systemctl poweroff; mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym Mod4+n mode "default"
}
mode "resize" {
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym Mod4+r mode "default"
}
bindsym Mod4+n mode $power
bindsym Mod4+r mode "resize"
'';
};
};
};
};
}

View File

@ -0,0 +1,398 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.desktop.sway;
programs = {
term = [
{
exec = "wezterm";
class = "WezTerm";
}
];
editor = [
{
exec = "code";
class = "code";
}
];
browser = [
{
exec = "google-chrome-stable";
class = "google-chrome";
}
];
music = [
{
exec = "shortwave";
class = "shortwave";
}
];
mail = [
{
exec = "mailspring";
class = "mailspring";
}
];
chat = [ ];
};
in
{
options = {
profile = {
desktop = {
sway = {
enable = mkEnableOption "Sway";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
scrot
wl-clipboard
];
};
programs = {
feh = {
enable = true;
};
wlogout = {
enable = true;
};
wpaperd = {
enable = true;
};
rofi = {
enable = true;
package = pkgs.rofi-wayland;
font = "DejaVu Sans Mono 14";
terminal = "${pkgs.wezterm}/bin/wezterm";
theme = "solarized";
plugins = with pkgs; [
rofi-calc
rofi-file-browser
rofi-power-menu
rofi-pulse-select
rofi-systemd
rofi-vpn
];
extraConfig = {
modi = "window,drun,ssh";
};
};
swaylock = {
enable = true;
settings = {
scaling = "fill";
image = "${config.home.homeDirectory}/.wallpapers/light.jpg";
};
};
waybar = {
enable = true;
# settings = {
# general = {
# position = "top";
# };
# };
};
};
services = {
gnome-keyring = {
enable = true;
};
caffeine = {
enable = true;
};
blueman-applet = {
enable = true;
};
clipman = {
enable = true;
};
network-manager-applet = {
enable = true;
};
playerctld = {
enable = true;
};
flameshot = {
enable = true;
};
kanshi = {
enable = true;
};
swayidle = {
enable = true;
};
swayosd = {
enable = true;
};
# mako = {
# enable = true;
# };
dunst = {
enable = true;
iconTheme = {
name = "Numix";
package = pkgs.numix-icon-theme;
size = "64x64";
};
settings = {
global = {
font = "DejaVu Sans Mono 14";
frame_color = "#93a1a1";
separator_color = "#93a1a1";
};
urgency_normal = {
msg_urgency = "normal";
background = "#586e75";
foreground = "#93a1a1";
};
urgency_critical = {
msg_urgency = "critical";
background = "#dc322f";
foreground = "#eee8d5";
};
urgency_low = {
msg_urgency = "low";
background = "#073642";
foreground = "#657b83";
};
};
};
};
wayland = {
windowManager = {
sway = {
enable = true;
config = {
terminal = "${pkgs.wezterm}/bin/wezterm";
bars = mkDefault [ ];
# modes = mkDefault { };
fonts = {
size = 14.0;
names = [
"DejaVu Sans Mono"
];
};
floating = {
modifier = "Mod4";
};
assigns = {
"1" = map (i: { class = i.class; }) programs.term;
"2" = map (i: { class = i.class; }) programs.editor;
"3" = map (i: { class = i.class; }) programs.browser;
"4" = map (i: { class = i.class; }) programs.mail;
"5" = map (i: { class = i.class; }) programs.music;
"6" = map (i: { class = i.class; }) programs.chat;
};
startup = [
{
command = "feh --no-fehbg --bg-scale ${config.home.homeDirectory}/.wallpapers/tower.jpg";
always = false;
}
{
command = "systemctl --user restart waybar";
always = true;
}
{
command = "systemctl --user restart dunst";
always = true;
}
{
command = "systemctl --user restart udiskie";
always = true;
}
{
command = "systemctl --user restart nm-applet";
always = true;
}
{
command = "systemctl --user restart blueman-applet";
always = true;
}
] ++ (map (i: { command = i.exec; }) programs.term) ++ (map (i: { command = i.exec; }) programs.editor) ++ (map (i: { command = i.exec; }) programs.browser) ++ (map (i: { command = i.exec; }) programs.mail) ++ (map (i: { command = i.exec; }) programs.music) ++ (map (i: { command = i.exec; }) programs.chat);
gaps = {
smartGaps = true;
inner = 12;
};
colors = {
focused = {
border = "#002b36";
background = "#586e75";
text = "#fdf6e3";
indicator = "#268bd2";
childBorder = "#586e75";
};
focusedInactive = {
border = "#002b36";
background = "#073642";
text = "#839496";
indicator = "#073642";
childBorder = "#073642";
};
unfocused = {
border = "#002b36";
background = "#073642";
text = "#839496";
indicator = "#073642";
childBorder = "#073642";
};
urgent = {
border = "#002b36";
background = "#dc322f";
text = "#fdf6e3";
indicator = "#002b36";
childBorder = "#dc322f";
};
};
# keybindings = {
# "XF86AudioPlay" = "exec --no-startup-id playerctl play-pause";
# "XF86AudioPrev" = "exec --no-startup-id playerctl previous";
# "XF86AudioNext" = "exec --no-startup-id playerctl next";
# "XF86AudioStop" = "exec --no-startup-id playerctl stop";
# "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise";
# "XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower";
# "XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle";
# "XF86AudioMicMute" = "exec swayosd-client --input-volume mute-toggle";
# "XF86MonBrightnessUp" = "exec swayosd-client --brightness raise";
# "XF86MonBrightnessDown" = "exec swayosd-client --brightness lower";
# "--release Print" = "exec ${pkgs.scrot}/bin/scrot";
# "--release Shift+Print" = "exec ${pkgs.scrot}/bin/scrot -u";
# "--release Ctrl+Print" = "exec ${pkgs.scrot}/bin/scrot -s";
# "Mod4+d" = "exec ${pkgs.rofi}/bin/rofi -show drun";
# "Mod4+Return" = "exec ${pkgs.wezterm}/bin/wezterm";
# "Mod4+Shift+q" = "kill";
# "Mod4+Left" = "focus left";
# "Mod4+Down" = "focus down";
# "Mod4+Up" = "focus up";
# "Mod4+Right" = "focus right";
# "Mod4+Shift+Left" = "move left";
# "Mod4+Shift+Down" = "move down";
# "Mod4+Shift+Up" = "move up";
# "Mod4+Shift+Right" = "move right";
# "Mod4+h" = "split h";
# "Mod4+v" = "split v";
# "Mod4+f" = "fullscreen toggle";
# "Mod4+s" = "layout stacking";
# "Mod4+w" = "layout tabbed";
# "Mod4+e" = "layout toggle split";
# "Mod4+Shift+Space" = "floating toggle";
# "Mod4+Space" = "focus mode_toggle";
# "Mod4+1" = "workspace number 1";
# "Mod4+2" = "workspace number 2";
# "Mod4+3" = "workspace number 3";
# "Mod4+4" = "workspace number 4";
# "Mod4+5" = "workspace number 5";
# "Mod4+6" = "workspace number 6";
# "Mod4+7" = "workspace number 7";
# "Mod4+8" = "workspace number 8";
# "Mod4+9" = "workspace number 9";
# "Mod4+Shift+1" = "move container to workspace number 1";
# "Mod4+Shift+2" = "move container to workspace number 2";
# "Mod4+Shift+3" = "move container to workspace number 3";
# "Mod4+Shift+4" = "move container to workspace number 4";
# "Mod4+Shift+5" = "move container to workspace number 5";
# "Mod4+Shift+6" = "move container to workspace number 6";
# "Mod4+Shift+7" = "move container to workspace number 7";
# "Mod4+Shift+8" = "move container to workspace number 8";
# "Mod4+Shift+9" = "move container to workspace number 9";
# "Mod4+Shift+c" = "reload";
# "Mod4+Shift+r" = "restart";
# };
};
# extraConfig = ''
# set $power "[l]ock log[o]ut [s]uspend [h]ibernate [r]eboot [p]oweroff"
# mode $power {
# bindsym l exec ${pkgs.swaylock}/bin/swaylock; mode "default"
# bindsym o exec swaymsg exit; mode "default"
# bindsym s exec systemctl suspend; mode "default"
# bindsym h exec systemctl hibernate; mode "default"
# bindsym r exec systemctl reboot; mode "default"
# bindsym p exec systemctl poweroff; mode "default"
# bindsym Return mode "default"
# bindsym Escape mode "default"
# bindsym Mod4+n mode "default"
# }
# mode "resize" {
# bindsym Left resize shrink width 10 px or 10 ppt
# bindsym Down resize grow height 10 px or 10 ppt
# bindsym Up resize shrink height 10 px or 10 ppt
# bindsym Right resize grow width 10 px or 10 ppt
# bindsym Return mode "default"
# bindsym Escape mode "default"
# bindsym Mod4+r mode "default"
# }
# bindsym Mod4+n mode $power
# bindsym Mod4+r mode "resize"
# '';
swaynag = {
enable = true;
};
};
};
};
};
}

BIN
home/thomas/face.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 KiB

View File

@ -2,17 +2,13 @@
{
imports = [
./autorandr.nix
./dircolors.nix
./ghtoken.nix
./git.nix
./hacking.nix
./kustomize.nix
./github.nix
./gopass.nix
./minio.nix
./netrc.nix
./shell.nix
./ssh.nix
./starship.nix
./vscode.nix
./zsh.nix
];
}

View File

@ -0,0 +1,142 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.git;
in
{
options = {
profile = {
programs = {
git = {
enable = mkEnableOption "Git";
};
};
};
};
config = mkIf cfg.enable {
home = {
shellAliases = {
gs = "git status";
gc = "git commit";
gp = "git push";
gl = "git pull";
status = "git status";
commit = "git commit";
push = "git push";
pull = "git pull";
};
};
services = {
gpg-agent = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
pinentryFlavor = "gnome3";
};
};
programs = {
git = {
enable = true;
userName = "Thomas Boerger";
userEmail = "thomas@webhippie.de";
signing = {
key = "0xF630596501026DB5";
signByDefault = true;
};
aliases = {
ci = "commit";
di = "diff";
st = "status";
co = "checkout";
br = "branch";
pu = "push";
pl = "pull";
cat = "cat-file -p";
rc = "rebase --continue";
rs = "rebase --skip";
unstage = "reset HEAD";
uncommit = "reset --soft HEAD^";
stag = "tag -s";
tags = "tag -l";
branches = "branch -a";
remotes = "remote -v";
fap = "fetch --all --prune";
hist = "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short";
amend = "commit --amend -C HEAD";
assume = "!git update-index --assume-unchanged";
unassume = "!git update-index --no-assume-unchanged";
assumed = "!git ls-files -v | grep ^h | cut -c 3-";
snapshot = "!git stash save \"snapshot: $(date)\" && git stash apply \"stash@{0}\"";
snapshots = "!git stash list --grep snapshot";
conflicts = "!git ls-files -u | awk '{print $4}' | sort -u";
resolve = "!git conflicts | xargs git add";
};
ignores = [
".DS_Store"
".envrc"
".vscode"
];
extraConfig = {
color = {
ui = "auto";
branch = "auto";
diff = "auto";
interactive = "auto";
status = "auto";
};
core = {
quotepath = false;
};
diff = {
algorithm = "patience";
};
format = {
signoff = true;
};
github = {
user = "tboerger";
};
init = {
defaultBranch = "master";
};
merge = {
log = true;
};
pager = {
branch = false;
tag = false;
};
pull = {
rebase = true;
};
push = {
default = "simple";
};
};
lfs = {
enable = true;
};
};
};
};
}

View File

@ -0,0 +1,48 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.github;
in
{
options = {
profile = {
programs = {
github = {
enable = mkEnableOption "GitHub";
};
};
};
};
config = mkIf cfg.enable {
programs = {
gh = {
enable = true;
extensions = with pkgs; [
gh-dash
gh-markdown-preview
gh-poi
];
};
zsh = {
sessionVariables = {
GH_TOKEN = "$(cat ${config.home.homeDirectory}/.ghtoken)";
GITHUB_TOKEN = "$(cat ${config.home.homeDirectory}/.ghtoken)";
};
};
};
homeage = {
file."ghtoken" = {
source = ../secrets/gh.age;
symlinks = [ "${config.home.homeDirectory}/.ghtoken" ];
owner = "thomas";
group = "thomas";
mode = "0600";
};
};
};
}

View File

@ -0,0 +1,66 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.gopass;
in
{
options = {
profile = {
programs = {
gopass = {
enable = mkEnableOption "Gopass";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
gopass
];
};
xdg = {
configFile = {
"gopass/config" = {
text = ''
[core]
notifications = true
exportkeys = true
autoimport = true
cliptimeout = 45
autoclip = false
showsafecontent = false
parsing = true
nopager = false
[age]
usekeychain = false
[mounts]
path = ${config.xdg.dataHome}/gopass/stores/root
[mounts "cloudpunks"]
path = ${config.xdg.dataHome}/gopass/stores/cloudpunks
[mounts "restlos"]
path = ${config.xdg.dataHome}/gopass/stores/restlos
[mounts "adorsys"]
path = ${config.xdg.dataHome}/gopass/stores/adorsys
[mounts "webhippie"]
path = ${config.xdg.dataHome}/gopass/stores/webhippie
[mounts "boerger"]
path = ${config.xdg.dataHome}/gopass/stores/boerger
[mounts "gopad"]
path = ${config.xdg.dataHome}/gopass/stores/gopad
[mounts "kleister"]
path = ${config.xdg.dataHome}/gopass/stores/kleister
'';
};
};
};
};
}

View File

@ -0,0 +1,36 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.minio;
in
{
options = {
profile = {
programs = {
minio = {
enable = mkEnableOption "Minio";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
minio-client
];
};
homeage = {
file."minio" = {
source = ../secrets/minio.age;
symlinks = [ "${config.home.homeDirectory}/.mc/config.json" ];
owner = "thomas";
group = "thomas";
mode = "0600";
};
};
};
}

View File

@ -0,0 +1,30 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.netrc;
in
{
options = {
profile = {
programs = {
netrc = {
enable = mkEnableOption "Netrc";
};
};
};
};
config = mkIf cfg.enable {
homeage = {
file."netrc" = {
source = ../secrets/netrc.age;
symlinks = [ "${config.home.homeDirectory}/.netrc" ];
owner = "thomas";
group = "thomas";
mode = "0600";
};
};
};
}

Some files were not shown because too many files have changed in this diff Show More