Format
Some checks failed
/ check (push) Failing after 9s

This commit is contained in:
Daniel Flanagan 2025-02-14 13:31:18 -06:00
parent 8e8a483e97
commit d21df887fe
51 changed files with 4363 additions and 3873 deletions

View file

@ -3,6 +3,7 @@ auto-format = true
file-types = ["nix"] file-types = ["nix"]
name = "nix" name = "nix"
scope = "source.nix" scope = "source.nix"
language-servers = ["nixd", "nil"]
[language.formatter] [language.formatter]
args = ["-"] args = ["-"]

View file

@ -1,101 +1,104 @@
{lib, ...}: { { lib, ... }:
schemes = let {
mkColorScheme = scheme @ { schemes =
scheme-name, let
bg, mkColorScheme =
bg2, scheme@{
bg3, scheme-name,
bg4, bg,
bg5, bg2,
fg, bg3,
fg2, bg4,
fg3, bg5,
fgdim, fg,
# pink, fg2,
purple, fg3,
red, fgdim,
orange, # pink,
yellow, purple,
green, red,
# teal, orange,
blue, yellow,
}: let green,
base = # teal,
{ blue,
text = fg; }:
primary = blue; let
urgent = red; base = {
text = fg;
primary = blue;
urgent = red;
# blacks # blacks
"0" = bg4; "0" = bg4;
"8" = bg5; "8" = bg5;
"1" = red; "1" = red;
"9" = red; "9" = red;
"2" = green; "2" = green;
"10" = green; "10" = green;
"3" = orange; "3" = orange;
"11" = orange; "11" = orange;
"4" = blue; "4" = blue;
"12" = blue; "12" = blue;
"5" = purple; "5" = purple;
"13" = purple; "13" = purple;
"6" = yellow; "6" = yellow;
"14" = yellow; "14" = yellow;
# whites # whites
"7" = fg2; "7" = fg2;
"15" = fg3; "15" = fg3;
} } // scheme;
// scheme; in
base
// {
withHashPrefix = lib.mapAttrs (_: value: "#${value}") base;
};
in in
base {
// { donokai = mkColorScheme {
withHashPrefix = lib.mapAttrs (_: value: "#${value}") base; scheme-name = "donokai";
bg = "110f0a";
bg2 = "181818";
bg3 = "222222";
bg4 = "292929";
bg5 = "333333";
fg = "f8f8f8";
fg2 = "d8d8d8";
fg3 = "c8c8c8";
fgdim = "666666";
red = "f92672";
green = "a6e22e";
yellow = "f4bf75";
blue = "66d9ef";
purple = "ae81ff";
# teal = "a1efe4";
orange = "fab387";
}; };
in { catppuccin-mocha-sapphire = mkColorScheme {
donokai = mkColorScheme { scheme-name = "catppuccin-mocha-sapphire";
scheme-name = "donokai"; bg = "1e1e2e";
bg = "110f0a"; bg2 = "181825";
bg2 = "181818"; bg3 = "313244";
bg3 = "222222"; bg4 = "45475a";
bg4 = "292929"; bg5 = "585b70";
bg5 = "333333";
fg = "f8f8f8"; fg = "cdd6f4";
fg2 = "d8d8d8"; fg2 = "bac2de";
fg3 = "c8c8c8"; fg3 = "a6adc8";
fgdim = "666666"; fgdim = "6c7086";
red = "f92672"; # pink = "f5e0dc";
green = "a6e22e"; purple = "cba6f7";
yellow = "f4bf75"; red = "f38ba8";
blue = "66d9ef"; orange = "fab387";
purple = "ae81ff"; yellow = "f9e2af";
# teal = "a1efe4"; green = "a6e3a1";
orange = "fab387"; # teal = "94e2d5";
blue = "74c7ec";
};
}; };
catppuccin-mocha-sapphire = mkColorScheme {
scheme-name = "catppuccin-mocha-sapphire";
bg = "1e1e2e";
bg2 = "181825";
bg3 = "313244";
bg4 = "45475a";
bg5 = "585b70";
fg = "cdd6f4";
fg2 = "bac2de";
fg3 = "a6adc8";
fgdim = "6c7086";
# pink = "f5e0dc";
purple = "cba6f7";
red = "f38ba8";
orange = "fab387";
yellow = "f9e2af";
green = "a6e3a1";
# teal = "94e2d5";
blue = "74c7ec";
};
};
} }

View file

@ -1,11 +1,19 @@
{self, ...}: let { self, ... }:
let
forSelfOverlay = forSelfOverlay =
if builtins.hasAttr "overlays" self && builtins.hasAttr "forSelf" self.overlays if builtins.hasAttr "overlays" self && builtins.hasAttr "forSelf" self.overlays then
then self.overlays.forSelf self.overlays.forSelf
else (_: p: p); else
in rec { (_: p: p);
systems = ["aarch64-linux" "aarch64-darwin" "x86_64-darwin" "x86_64-linux"]; in
rec {
systems = [
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
];
forSystems = nixpkgs: nixpkgs.lib.genAttrs systems; forSystems = nixpkgs: nixpkgs.lib.genAttrs systems;
pkgsFor = nixpkgs: system: (import nixpkgs {inherit system;}).extend forSelfOverlay; pkgsFor = nixpkgs: system: (import nixpkgs { inherit system; }).extend forSelfOverlay;
genPkgs = nixpkgs: func: (forSystems nixpkgs (system: func (pkgsFor nixpkgs system))); genPkgs = nixpkgs: func: (forSystems nixpkgs (system: func (pkgsFor nixpkgs system)));
} }

View file

@ -1,12 +1,14 @@
{nixpkgs-unstable, ...}: let { nixpkgs-unstable, ... }:
let
# TODO: This file needs some serious cleaning up. # TODO: This file needs some serious cleaning up.
lib = nixpkgs-unstable.lib; lib = nixpkgs-unstable.lib;
inherit (lib.attrsets) mapAttrs' filterAttrs; inherit (lib.attrsets) mapAttrs' filterAttrs;
ESP = inputs @ { ESP =
size ? "4G", inputs@{
label ? "ESP", size ? "4G",
name ? "ESP", label ? "ESP",
}: name ? "ESP",
}:
{ {
priority = 1; priority = 1;
start = "1M"; start = "1M";
@ -24,68 +26,75 @@
}; };
} }
// inputs; // inputs;
in rec { in
standardWithHibernateSwap = { rec {
esp ? { standardWithHibernateSwap =
label = "ESP"; {
size = "4G"; esp ? {
name = "ESP"; label = "ESP";
}, size = "4G";
rootfsName ? "/rootfs", name = "ESP";
homeName ? "/home", },
disk, rootfsName ? "/rootfs",
swapSize, homeName ? "/home",
... disk,
}: { swapSize,
/* ...
this is my standard partitioning scheme for my machines which probably want hibernation capabilities }:
a UEFI-compatible boot partition {
it includes an LUKS-encrypted btrfs volume /*
a swap partition big enough to dump all the machine's RAM into this is my standard partitioning scheme for my machines which probably want hibernation capabilities
*/ a UEFI-compatible boot partition
it includes an LUKS-encrypted btrfs volume
a swap partition big enough to dump all the machine's RAM into
*/
disko.devices = { disko.devices = {
disk = { disk = {
primary = { primary = {
type = "disk"; type = "disk";
device = disk; device = disk;
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
ESP = ESP esp; ESP = ESP esp;
swap = { swap = {
size = swapSize; size = swapSize;
content = {
type = "swap";
discardPolicy = "both";
resumeDevice = true; # resume from hiberation from this device
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
# if you want to use the key for interactive login be sure there is no trailing newline
# for example use `echo -n "password" > /tmp/secret.key`
keyFile = "/tmp/secret.key"; # Interactive
# settings.keyFile = "/tmp/password.key";
# additionalKeyFiles = ["/tmp/additionalSecret.key"];
content = { content = {
type = "btrfs"; type = "swap";
extraArgs = ["-f"]; discardPolicy = "both";
subvolumes = { resumeDevice = true; # resume from hiberation from this device
${rootfsName} = { };
mountpoint = "/"; };
mountOptions = ["compress=zstd"]; luks = {
}; size = "100%";
${homeName} = { content = {
mountpoint = "/home"; type = "luks";
mountOptions = ["compress=zstd"]; name = "crypted";
}; # if you want to use the key for interactive login be sure there is no trailing newline
"/nix" = { # for example use `echo -n "password" > /tmp/secret.key`
mountpoint = "/nix"; keyFile = "/tmp/secret.key"; # Interactive
mountOptions = ["compress=zstd" "noatime"]; # settings.keyFile = "/tmp/password.key";
# additionalKeyFiles = ["/tmp/additionalSecret.key"];
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
${rootfsName} = {
mountpoint = "/";
mountOptions = [ "compress=zstd" ];
};
${homeName} = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [
"compress=zstd"
"noatime"
];
};
}; };
}; };
}; };
@ -96,7 +105,6 @@ in rec {
}; };
}; };
}; };
};
foxtrot = standardWithHibernateSwap { foxtrot = standardWithHibernateSwap {
disk = "nvme0n1"; disk = "nvme0n1";
@ -109,51 +117,57 @@ in rec {
}; };
}; };
standard = { standard =
esp ? { {
label = "ESP"; esp ? {
size = "4G"; label = "ESP";
name = "ESP"; size = "4G";
}, name = "ESP";
disk, },
... disk,
}: { ...
# this is my standard partitioning scheme for my machines: an LUKS-encrypted }:
# btrfs volume {
disko.devices = { # this is my standard partitioning scheme for my machines: an LUKS-encrypted
disk = { # btrfs volume
primary = { disko.devices = {
type = "disk"; disk = {
device = disk; primary = {
content = { type = "disk";
type = "gpt"; device = disk;
partitions = { content = {
ESP = ESP esp; type = "gpt";
luks = { partitions = {
size = "100%"; ESP = ESP esp;
content = { luks = {
type = "luks"; size = "100%";
name = "crypted";
# if you want to use the key for interactive login be sure there is no trailing newline
# for example use `echo -n "password" > /tmp/secret.key`
keyFile = "/tmp/secret.key"; # Interactive
# settings.keyFile = "/tmp/password.key";
# additionalKeyFiles = ["/tmp/additionalSecret.key"];
content = { content = {
type = "btrfs"; type = "luks";
extraArgs = ["-f"]; name = "crypted";
subvolumes = { # if you want to use the key for interactive login be sure there is no trailing newline
"/root" = { # for example use `echo -n "password" > /tmp/secret.key`
mountpoint = "/"; keyFile = "/tmp/secret.key"; # Interactive
mountOptions = ["compress=zstd"]; # settings.keyFile = "/tmp/password.key";
}; # additionalKeyFiles = ["/tmp/additionalSecret.key"];
"/home" = { content = {
mountpoint = "/home"; type = "btrfs";
mountOptions = ["compress=zstd"]; extraArgs = [ "-f" ];
}; subvolumes = {
"/nix" = { "/root" = {
mountpoint = "/nix"; mountpoint = "/";
mountOptions = ["compress=zstd" "noatime"]; mountOptions = [ "compress=zstd" ];
};
"/home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [
"compress=zstd"
"noatime"
];
};
}; };
}; };
}; };
@ -164,7 +178,6 @@ in rec {
}; };
}; };
}; };
};
thablet = standard { thablet = standard {
disk = "nvme0n1"; disk = "nvme0n1";
@ -175,34 +188,40 @@ in rec {
}; };
}; };
unencrypted = {disk, ...}: { unencrypted =
disko.devices = { { disk, ... }:
disk = { {
primary = { disko.devices = {
type = "disk"; disk = {
device = disk; primary = {
content = { type = "disk";
type = "gpt"; device = disk;
partitions = { content = {
ESP = ESP {size = "5G";}; type = "gpt";
root = { partitions = {
size = "100%"; ESP = ESP { size = "5G"; };
content = { root = {
type = "btrfs"; size = "100%";
extraArgs = ["-f"]; content = {
mountpoint = "/partition-root"; type = "btrfs";
subvolumes = { extraArgs = [ "-f" ];
"/rootfs" = { mountpoint = "/partition-root";
mountpoint = "/"; subvolumes = {
mountOptions = ["compress=zstd"]; "/rootfs" = {
}; mountpoint = "/";
"/home" = { mountOptions = [ "compress=zstd" ];
mountpoint = "/home"; };
mountOptions = ["compress=zstd"]; "/home" = {
}; mountpoint = "/home";
"/nix" = { mountOptions = [ "compress=zstd" ];
mountpoint = "/nix"; };
mountOptions = ["compress=zstd" "noatime"]; "/nix" = {
mountpoint = "/nix";
mountOptions = [
"compress=zstd"
"noatime"
];
};
}; };
}; };
}; };
@ -212,242 +231,253 @@ in rec {
}; };
}; };
}; };
};
beefcake = let beefcake =
zpools = { let
zroot = { zpools = {
/* zroot = {
TODO: at the time of writing, disko does not support draid6 /*
so I'm building/managing the array manually for the time being TODO: at the time of writing, disko does not support draid6
the root pool is just a single disk right now so I'm building/managing the array manually for the time being
*/ the root pool is just a single disk right now
name = "zroot"; */
config = { name = "zroot";
type = "zpool"; config = {
# mode = "draid6"; type = "zpool";
rootFsOptions = { # mode = "draid6";
compression = "zstd"; rootFsOptions = {
"com.sun:auto-snapshot" = "false"; compression = "zstd";
}; "com.sun:auto-snapshot" = "false";
mountpoint = "/"; };
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank"; mountpoint = "/";
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank";
datasets = { datasets = {
zfs_fs = { zfs_fs = {
type = "zfs_fs"; type = "zfs_fs";
mountpoint = "/zfs_fs"; mountpoint = "/zfs_fs";
options."com.sun:auto-snapshot" = "true"; options."com.sun:auto-snapshot" = "true";
};
zfs_unmounted_fs = {
type = "zfs_fs";
options.mountpoint = "none";
};
zfs_legacy_fs = {
type = "zfs_fs";
options.mountpoint = "legacy";
mountpoint = "/zfs_legacy_fs";
};
zfs_testvolume = {
type = "zfs_volume";
size = "10M";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/ext4onzfs";
}; };
}; zfs_unmounted_fs = {
encrypted = { type = "zfs_fs";
type = "zfs_fs"; options.mountpoint = "none";
options = {
mountpoint = "none";
encryption = "aes-256-gcm";
keyformat = "passphrase";
keylocation = "file:///tmp/secret.key";
}; };
# use this to read the key during boot zfs_legacy_fs = {
/* type = "zfs_fs";
postCreateHook = '' options.mountpoint = "legacy";
zfs set keylocation="prompt" "zroot/$name"; mountpoint = "/zfs_legacy_fs";
'';
*/
};
"encrypted/test" = {
type = "zfs_fs";
mountpoint = "/zfs_crypted";
};
};
};
};
zstorage = {
/*
PARITY_COUNT=3 NUM_DRIVES=8 HOT_SPARES=2 sudo -E zpool create -f -O mountpoint=none -O compression=on -O xattr=sa -O acltype=posixacl -o ashift=12 -O atime=off -O recordsize=64K zstorage draid{$PARITY_COUNT}:{$NUM_DRIVES}c:{$HOT_SPARES}s /dev/disk/by-id/scsi-35000039548cb637c /dev/disk/by-id/scsi-35000039548cb7c8c /dev/disk/by-id/scsi-35000039548cb85c8 /dev/disk/by-id/scsi-35000039548d9b504 /dev/disk/by-id/scsi-35000039548da2b08 /dev/disk/by-id/scsi-35000039548dad2fc /dev/disk/by-id/scsi-350000399384be921 /dev/disk/by-id/scsi-35000039548db096c
sudo zfs create -o mountpoint=legacy zstorage/nix
sudo zfs create -o canmount=on -o mountpoint=/storage zstorage/storage
*/
name = "zstorage";
config = {};
};
};
diskClass = {
storage = {
type = "zfs";
pool = zpools.zroot.name;
};
boot = {
content = {
type = "gpt";
partitions = {
ESP = {
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
}; };
}; zfs_testvolume = {
zfs = { type = "zfs_volume";
size = "100%"; size = "10M";
content = { content = {
type = "zfs"; type = "filesystem";
pool = zpools.zroot.name; format = "ext4";
mountpoint = "/ext4onzfs";
};
};
encrypted = {
type = "zfs_fs";
options = {
mountpoint = "none";
encryption = "aes-256-gcm";
keyformat = "passphrase";
keylocation = "file:///tmp/secret.key";
};
# use this to read the key during boot
/*
postCreateHook = ''
zfs set keylocation="prompt" "zroot/$name";
'';
*/
};
"encrypted/test" = {
type = "zfs_fs";
mountpoint = "/zfs_crypted";
}; };
}; };
}; };
}; };
zstorage = {
/*
PARITY_COUNT=3 NUM_DRIVES=8 HOT_SPARES=2 sudo -E zpool create -f -O mountpoint=none -O compression=on -O xattr=sa -O acltype=posixacl -o ashift=12 -O atime=off -O recordsize=64K zstorage draid{$PARITY_COUNT}:{$NUM_DRIVES}c:{$HOT_SPARES}s /dev/disk/by-id/scsi-35000039548cb637c /dev/disk/by-id/scsi-35000039548cb7c8c /dev/disk/by-id/scsi-35000039548cb85c8 /dev/disk/by-id/scsi-35000039548d9b504 /dev/disk/by-id/scsi-35000039548da2b08 /dev/disk/by-id/scsi-35000039548dad2fc /dev/disk/by-id/scsi-350000399384be921 /dev/disk/by-id/scsi-35000039548db096c
sudo zfs create -o mountpoint=legacy zstorage/nix
sudo zfs create -o canmount=on -o mountpoint=/storage zstorage/storage
*/
name = "zstorage";
config = { };
};
}; };
}; diskClass = {
bootDisks = { storage = {
"/dev/sdi" = { type = "zfs";
name = "i"; pool = zpools.zroot.name;
enable = true; };
}; boot = {
"/dev/sdj" = {
name = "j";
enable = true;
}; # TODO: join current boot drive to new boot pool
};
storageDisks = {
"/dev/sda" = {
enable = true;
name = "a";
};
"/dev/sdb" = {
enable = true;
name = "b";
};
"/dev/sdc" = {
enable = true;
name = "c";
};
"/dev/sdd" = {
enable = true;
name = "d";
};
# TODO: start small
"/dev/sde" = {
enable = false;
name = "e";
};
"/dev/sdf" = {
enable = false;
name = "f";
};
"/dev/sdg" = {
enable = false;
name = "g";
};
"/dev/sdh" = {
enable = false;
name = "h";
};
# gap for two boot drives
"/dev/sdk" = {
enable = false;
name = "k";
};
"/dev/sdl" = {
enable = false;
name = "l";
};
"/dev/sdm" = {
enable = false;
name = "m";
};
"/dev/sdn" = {
# TODO: this is my holding cell for random stuff right now
enable = false;
name = "n";
};
};
diskoBoot = mapAttrs' (device: {name, ...}: {
name = "boot-${name}";
value = {
inherit device;
type = "disk";
content = diskClass.boot.content;
};
}) (filterAttrs (_: {enable, ...}: enable) bootDisks);
diskoStorage = mapAttrs' (device: {name, ...}: {
name = "storage-${name}";
value = {
inherit device;
type = "disk";
content = diskClass.storage.content;
};
}) (filterAttrs (_: {enable, ...}: enable) storageDisks);
in {
disko.devices = {
disk = diskoBoot // diskoStorage;
zpool = {
zroot = zpools.zroot.config;
};
};
};
legacy = {disks, ...}: {
disko.devices = {
disk = {
primary = {
device = builtins.elemAt disks 0;
type = "disk";
content = { content = {
type = "table"; type = "gpt";
format = "gpt"; partitions = {
partitions = [ ESP = {
{ size = "1G";
label = "EFI"; type = "EF00";
name = "ESP";
size = "512M";
bootable = true;
content = { content = {
type = "filesystem"; type = "filesystem";
format = "vfat"; format = "vfat";
mountpoint = "/boot"; mountpoint = "/boot";
}; };
} };
{ zfs = {
name = "root"; size = "100%";
start = "500M";
end = "100%";
part-type = "primary";
bootable = true;
content = { content = {
type = "filesystem"; type = "zfs";
format = "ext4"; pool = zpools.zroot.name;
mountpoint = "/";
}; };
} };
]; };
};
};
};
bootDisks = {
"/dev/sdi" = {
name = "i";
enable = true;
};
"/dev/sdj" = {
name = "j";
enable = true;
}; # TODO: join current boot drive to new boot pool
};
storageDisks = {
"/dev/sda" = {
enable = true;
name = "a";
};
"/dev/sdb" = {
enable = true;
name = "b";
};
"/dev/sdc" = {
enable = true;
name = "c";
};
"/dev/sdd" = {
enable = true;
name = "d";
};
# TODO: start small
"/dev/sde" = {
enable = false;
name = "e";
};
"/dev/sdf" = {
enable = false;
name = "f";
};
"/dev/sdg" = {
enable = false;
name = "g";
};
"/dev/sdh" = {
enable = false;
name = "h";
};
# gap for two boot drives
"/dev/sdk" = {
enable = false;
name = "k";
};
"/dev/sdl" = {
enable = false;
name = "l";
};
"/dev/sdm" = {
enable = false;
name = "m";
};
"/dev/sdn" = {
# TODO: this is my holding cell for random stuff right now
enable = false;
name = "n";
};
};
diskoBoot = mapAttrs' (
device:
{ name, ... }:
{
name = "boot-${name}";
value = {
inherit device;
type = "disk";
content = diskClass.boot.content;
};
}
) (filterAttrs (_: { enable, ... }: enable) bootDisks);
diskoStorage = mapAttrs' (
device:
{ name, ... }:
{
name = "storage-${name}";
value = {
inherit device;
type = "disk";
content = diskClass.storage.content;
};
}
) (filterAttrs (_: { enable, ... }: enable) storageDisks);
in
{
disko.devices = {
disk = diskoBoot // diskoStorage;
zpool = {
zroot = zpools.zroot.config;
};
};
};
legacy =
{ disks, ... }:
{
disko.devices = {
disk = {
primary = {
device = builtins.elemAt disks 0;
type = "disk";
content = {
type = "table";
format = "gpt";
partitions = [
{
label = "EFI";
name = "ESP";
size = "512M";
bootable = true;
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
}
{
name = "root";
start = "500M";
end = "100%";
part-type = "primary";
bootable = true;
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
}
];
};
}; };
}; };
}; };
}; };
};
} }

View file

@ -1,4 +1,7 @@
{pkgs ? import <nixpkgs> {}}: let {
pkgs ? import <nixpkgs> { },
}:
let
# lock = builtins.fromJSON (builtins.readFile ../../../../../flake.lock); # lock = builtins.fromJSON (builtins.readFile ../../../../../flake.lock);
# nixpkgsRev = lock.nodes.nixpkgs.locked.rev; # nixpkgsRev = lock.nodes.nixpkgs.locked.rev;
# pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/${nixpkgsRev}.tar.gz") {}; # pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/${nixpkgsRev}.tar.gz") {};
@ -6,15 +9,15 @@
version = "1.0.0"; version = "1.0.0";
src = ./src; src = ./src;
in in
pkgs.rustPlatform.buildRustPackage { pkgs.rustPlatform.buildRustPackage {
inherit pname version src; inherit pname version src;
cargoHash = "sha256-6Wl3cOIxlPJjzEuzNhCBZJXayL8runQfAxPruvzh2Vc="; cargoHash = "sha256-6Wl3cOIxlPJjzEuzNhCBZJXayL8runQfAxPruvzh2Vc=";
# cargoHash = pkgs.lib.fakeHash; # cargoHash = pkgs.lib.fakeHash;
checkType = "release"; checkType = "release";
postBuild = '' postBuild = ''
# pushd target/*/release # pushd target/*/release
# ls -la # ls -la
# ${pkgs.upx}/bin/upx --best --lzma hyprland-workspaces-eww # ${pkgs.upx}/bin/upx --best --lzma hyprland-workspaces-eww
# popd # popd
''; '';
} }

View file

@ -5,9 +5,11 @@
lib, lib,
# font, # font,
... ...
}: let }:
let
inherit (style) colors; inherit (style) colors;
in { in
{
# TODO: Hyprland seems to sometimes use a ton of CPU? # TODO: Hyprland seems to sometimes use a ton of CPU?
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -64,9 +66,9 @@ in {
kb_options = "ctrl:nocaps"; kb_options = "ctrl:nocaps";
/* /*
kb_variant = kb_variant =
kb_model = kb_model =
kb_rules = kb_rules =
*/ */
follow_mouse = 2; follow_mouse = 2;
@ -114,10 +116,10 @@ in {
rounding_power = 4.0; rounding_power = 4.0;
/* /*
blur = "no"; blur = "no";
blur_size = 3 blur_size = 3
blur_passes = 1 blur_passes = 1
blur_new_optimizations = on blur_new_optimizations = on
*/ */
shadow = { shadow = {
@ -134,8 +136,8 @@ in {
bind = [ bind = [
# See https://wiki.hyprland.org/Configuring/Keywords/ for more # See https://wiki.hyprland.org/Configuring/Keywords/ for more
/* /*
"$mod, return, exec, wezterm" "$mod, return, exec, wezterm"
"$mod SHIFT, return, exec, wezterm" "$mod SHIFT, return, exec, wezterm"
*/ */
"$mod, return, exec, wezterm" "$mod, return, exec, wezterm"
"$mod SHIFT, return, exec, [float] wezterm start --always-new-process" "$mod SHIFT, return, exec, [float] wezterm start --always-new-process"
@ -217,7 +219,10 @@ in {
]; ];
# Move/resize windows with mod + LMB/RMB and dragging # Move/resize windows with mod + LMB/RMB and dragging
bindm = ["$mod, mouse:272, movewindow" "$mod, mouse:273, resizewindow"]; bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
}; };
extraConfig = '' extraConfig = ''
@ -376,55 +381,57 @@ in {
}; };
}; };
services.hypridle = let services.hypridle =
secondsPerMinute = 60; let
lockSeconds = 10 * secondsPerMinute; secondsPerMinute = 60;
in { lockSeconds = 10 * secondsPerMinute;
enable = true; in
settings = { {
general = { enable = true;
after_sleep_cmd = "hyprctl dispatch dpms on"; settings = {
before_sleep_cmd = "loginctl lock-session"; general = {
ignore_dbus_inhibit = false; after_sleep_cmd = "hyprctl dispatch dpms on";
lock_cmd = "pidof hyprlock || hyprlock"; before_sleep_cmd = "loginctl lock-session";
}; ignore_dbus_inhibit = false;
lock_cmd = "pidof hyprlock || hyprlock";
};
listener = [ listener = [
{ {
timeout = lockSeconds - 300; timeout = lockSeconds - 300;
on-timeout = ''notify-send "Auto-locking in 5 minutes"''; on-timeout = ''notify-send "Auto-locking in 5 minutes"'';
on-resume = ''notify-send "Auto-locking cancelled"''; on-resume = ''notify-send "Auto-locking cancelled"'';
} }
{ {
timeout = lockSeconds - 180; timeout = lockSeconds - 180;
on-timeout = ''notify-send "Auto-locking in 3 minutes"''; on-timeout = ''notify-send "Auto-locking in 3 minutes"'';
} }
{ {
timeout = lockSeconds - 120; timeout = lockSeconds - 120;
on-timeout = ''notify-send "Auto-locking in 2 minutes"''; on-timeout = ''notify-send "Auto-locking in 2 minutes"'';
} }
{ {
timeout = lockSeconds - 60; timeout = lockSeconds - 60;
on-timeout = ''notify-send "Auto-locking in 1 minute"''; on-timeout = ''notify-send "Auto-locking in 1 minute"'';
} }
{ {
timeout = lockSeconds - 30; timeout = lockSeconds - 30;
on-timeout = ''notify-send "Auto-locking in 30 seconds"''; on-timeout = ''notify-send "Auto-locking in 30 seconds"'';
} }
{ {
timeout = lockSeconds - 10; timeout = lockSeconds - 10;
on-timeout = ''notify-send -u critical "Auto-locking in 10 seconds"''; on-timeout = ''notify-send -u critical "Auto-locking in 10 seconds"'';
} }
{ {
timeout = lockSeconds; timeout = lockSeconds;
on-timeout = ''loginctl lock-session''; on-timeout = ''loginctl lock-session'';
} }
{ {
timeout = lockSeconds + 5; timeout = lockSeconds + 5;
on-timeout = ''hyprctl dispatch dpms off''; on-timeout = ''hyprctl dispatch dpms off'';
on-resume = ''hyprctl dispatch dpms on''; on-resume = ''hyprctl dispatch dpms on'';
} }
]; ];
};
}; };
};
} }

View file

@ -2,10 +2,11 @@
colors, colors,
font, font,
... ...
}: { }:
{
programs.kitty = { programs.kitty = {
enable = true; enable = true;
darwinLaunchOptions = ["--single-instance"]; darwinLaunchOptions = [ "--single-instance" ];
shellIntegration = { shellIntegration = {
enableFishIntegration = true; enableFishIntegration = true;
}; };

View file

@ -2,7 +2,7 @@
programs.plasma = { programs.plasma = {
enable = true; enable = true;
shortcuts = { shortcuts = {
"ActivityManager"."switch-to-activity-851c180f-d52d-4fe4-b7ed-a10e70cf4ce8" = []; "ActivityManager"."switch-to-activity-851c180f-d52d-4fe4-b7ed-a10e70cf4ce8" = [ ];
# "KDE Keyboard Layout Switcher"."Switch to Last-Used Keyboard Layout" = "Meta+Alt+L"; # "KDE Keyboard Layout Switcher"."Switch to Last-Used Keyboard Layout" = "Meta+Alt+L";
# "KDE Keyboard Layout Switcher"."Switch to Next Keyboard Layout" = "Meta+Alt+K"; # "KDE Keyboard Layout Switcher"."Switch to Next Keyboard Layout" = "Meta+Alt+K";
# "kaccess"."Toggle Screen Reader On and Off" = "Meta+Alt+S"; # "kaccess"."Toggle Screen Reader On and Off" = "Meta+Alt+S";
@ -15,10 +15,19 @@
"kmix"."increase_microphone_volume" = "Microphone Volume Up"; "kmix"."increase_microphone_volume" = "Microphone Volume Up";
"kmix"."increase_volume" = "Volume Up"; "kmix"."increase_volume" = "Volume Up";
"kmix"."increase_volume_small" = "Shift+Volume Up"; "kmix"."increase_volume_small" = "Shift+Volume Up";
"kmix"."mic_mute" = ["Microphone Mute" "Meta+Volume Mute,Microphone Mute" "Meta+Shift+V" "Meta+Volume Mute,Mute Microphone"]; "kmix"."mic_mute" = [
"Microphone Mute"
"Meta+Volume Mute,Microphone Mute"
"Meta+Shift+V"
"Meta+Volume Mute,Mute Microphone"
];
"kmix"."mute" = "Volume Mute"; "kmix"."mute" = "Volume Mute";
# "ksmserver"."Halt Without Confirmation" = "none,,Shut Down Without Confirmation"; # "ksmserver"."Halt Without Confirmation" = "none,,Shut Down Without Confirmation";
"ksmserver"."Lock Session" = ["Meta+Ctrl+Shift+L" "Screensaver,Meta+L" "Screensaver,Lock Session"]; "ksmserver"."Lock Session" = [
"Meta+Ctrl+Shift+L"
"Screensaver,Meta+L"
"Screensaver,Lock Session"
];
# "ksmserver"."Log Out" = "Ctrl+Alt+Del"; # "ksmserver"."Log Out" = "Ctrl+Alt+Del";
# "ksmserver"."Log Out Without Confirmation" = "none,,Log Out Without Confirmation"; # "ksmserver"."Log Out Without Confirmation" = "none,,Log Out Without Confirmation";
# "ksmserver"."LogOut" = "none,,Log Out"; # "ksmserver"."LogOut" = "none,,Log Out";
@ -31,19 +40,23 @@
# "kwin"."Decrease Opacity" = "none,,Decrease Opacity of Active Window by 5%"; # "kwin"."Decrease Opacity" = "none,,Decrease Opacity of Active Window by 5%";
# "kwin"."Edit Tiles" = "Meta+T"; # "kwin"."Edit Tiles" = "Meta+T";
"kwin"."Expose" = "Ctrl+F9"; "kwin"."Expose" = "Ctrl+F9";
"kwin"."ExposeAll" = ["Ctrl+F10" "Launch (C),Ctrl+F10" "Launch (C),Toggle Present Windows (All desktops)"]; "kwin"."ExposeAll" = [
"Ctrl+F10"
"Launch (C),Ctrl+F10"
"Launch (C),Toggle Present Windows (All desktops)"
];
"kwin"."ExposeClass" = "Ctrl+F7"; "kwin"."ExposeClass" = "Ctrl+F7";
"kwin"."ExposeClassCurrentDesktop" = []; "kwin"."ExposeClassCurrentDesktop" = [ ];
"kwin"."Grid View" = "Meta+G"; "kwin"."Grid View" = "Meta+G";
"kwin"."Increase Opacity" = "none,,Increase Opacity of Active Window by 5%"; "kwin"."Increase Opacity" = "none,,Increase Opacity of Active Window by 5%";
"kwin"."Kill Window" = "Meta+Ctrl+Esc"; "kwin"."Kill Window" = "Meta+Ctrl+Esc";
"kwin"."Move Tablet to Next Output" = []; "kwin"."Move Tablet to Next Output" = [ ];
"kwin"."MoveMouseToCenter" = "Meta+F6"; "kwin"."MoveMouseToCenter" = "Meta+F6";
"kwin"."MoveMouseToFocus" = "Meta+F5"; "kwin"."MoveMouseToFocus" = "Meta+F5";
"kwin"."MoveZoomDown" = []; "kwin"."MoveZoomDown" = [ ];
"kwin"."MoveZoomLeft" = []; "kwin"."MoveZoomLeft" = [ ];
"kwin"."MoveZoomRight" = []; "kwin"."MoveZoomRight" = [ ];
"kwin"."MoveZoomUp" = []; "kwin"."MoveZoomUp" = [ ];
"kwin"."Overview" = "Meta+W"; "kwin"."Overview" = "Meta+W";
"kwin"."Setup Window Shortcut" = "none,,Setup Window Shortcut"; "kwin"."Setup Window Shortcut" = "none,,Setup Window Shortcut";
"kwin"."Show Desktop" = "Meta+D"; "kwin"."Show Desktop" = "Meta+D";
@ -91,16 +104,19 @@
"kwin"."Switch to Screen Below" = "none,,Switch to Screen Below"; "kwin"."Switch to Screen Below" = "none,,Switch to Screen Below";
"kwin"."Switch to Screen to the Left" = "none,,Switch to Screen to the Left"; "kwin"."Switch to Screen to the Left" = "none,,Switch to Screen to the Left";
"kwin"."Switch to Screen to the Right" = "none,,Switch to Screen to the Right"; "kwin"."Switch to Screen to the Right" = "none,,Switch to Screen to the Right";
"kwin"."Toggle Night Color" = []; "kwin"."Toggle Night Color" = [ ];
"kwin"."Toggle Window Raise/Lower" = "none,,Toggle Window Raise/Lower"; "kwin"."Toggle Window Raise/Lower" = "none,,Toggle Window Raise/Lower";
"kwin"."Walk Through Windows" = "Alt+Tab"; "kwin"."Walk Through Windows" = "Alt+Tab";
"kwin"."Walk Through Windows (Reverse)" = "Alt+Shift+Tab"; "kwin"."Walk Through Windows (Reverse)" = "Alt+Shift+Tab";
"kwin"."Walk Through Windows Alternative" = "none,,Walk Through Windows Alternative"; "kwin"."Walk Through Windows Alternative" = "none,,Walk Through Windows Alternative";
"kwin"."Walk Through Windows Alternative (Reverse)" = "none,,Walk Through Windows Alternative (Reverse)"; "kwin"."Walk Through Windows Alternative (Reverse)" =
"none,,Walk Through Windows Alternative (Reverse)";
"kwin"."Walk Through Windows of Current Application" = "Alt+`"; "kwin"."Walk Through Windows of Current Application" = "Alt+`";
"kwin"."Walk Through Windows of Current Application (Reverse)" = "Alt+~"; "kwin"."Walk Through Windows of Current Application (Reverse)" = "Alt+~";
"kwin"."Walk Through Windows of Current Application Alternative" = "none,,Walk Through Windows of Current Application Alternative"; "kwin"."Walk Through Windows of Current Application Alternative" =
"kwin"."Walk Through Windows of Current Application Alternative (Reverse)" = "none,,Walk Through Windows of Current Application Alternative (Reverse)"; "none,,Walk Through Windows of Current Application Alternative";
"kwin"."Walk Through Windows of Current Application Alternative (Reverse)" =
"none,,Walk Through Windows of Current Application Alternative (Reverse)";
"kwin"."Window Above Other Windows" = "none,,Keep Window Above Others"; "kwin"."Window Above Other Windows" = "none,,Keep Window Above Others";
"kwin"."Window Below Other Windows" = "none,,Keep Window Below Others"; "kwin"."Window Below Other Windows" = "none,,Keep Window Below Others";
"kwin"."Window Close" = "Alt+F4"; "kwin"."Window Close" = "Alt+F4";
@ -175,7 +191,11 @@
"kwin"."Window to Screen 6" = "none,,Move Window to Screen 6"; "kwin"."Window to Screen 6" = "none,,Move Window to Screen 6";
"kwin"."Window to Screen 7" = "none,,Move Window to Screen 7"; "kwin"."Window to Screen 7" = "none,,Move Window to Screen 7";
"kwin"."view_actual_size" = "Meta+0"; "kwin"."view_actual_size" = "Meta+0";
"kwin"."view_zoom_in" = ["Meta++" "Meta+=,Meta++" "Meta+=,Zoom In"]; "kwin"."view_zoom_in" = [
"Meta++"
"Meta+=,Meta++"
"Meta+=,Zoom In"
];
"kwin"."view_zoom_out" = "Meta+-"; "kwin"."view_zoom_out" = "Meta+-";
"mediacontrol"."mediavolumedown" = "none,,Media volume down"; "mediacontrol"."mediavolumedown" = "none,,Media volume down";
"mediacontrol"."mediavolumeup" = "none,,Media volume up"; "mediacontrol"."mediavolumeup" = "none,,Media volume up";
@ -196,9 +216,17 @@
"org_kde_powerdevil"."PowerOff" = "Power Off"; "org_kde_powerdevil"."PowerOff" = "Power Off";
"org_kde_powerdevil"."Sleep" = "Sleep"; "org_kde_powerdevil"."Sleep" = "Sleep";
"org_kde_powerdevil"."Toggle Keyboard Backlight" = "Keyboard Light On/Off"; "org_kde_powerdevil"."Toggle Keyboard Backlight" = "Keyboard Light On/Off";
"org_kde_powerdevil"."Turn Off Screen" = []; "org_kde_powerdevil"."Turn Off Screen" = [ ];
"org_kde_powerdevil"."powerProfile" = ["Battery" "Meta+B,Battery" "Meta+B,Switch Power Profile"]; "org_kde_powerdevil"."powerProfile" = [
"plasmashell"."activate application launcher" = ["Meta" "Alt+F1,Meta" "Alt+F1,Activate Application Launcher"]; "Battery"
"Meta+B,Battery"
"Meta+B,Switch Power Profile"
];
"plasmashell"."activate application launcher" = [
"Meta"
"Alt+F1,Meta"
"Alt+F1,Activate Application Launcher"
];
"plasmashell"."activate task manager entry 1" = "Meta+1"; "plasmashell"."activate task manager entry 1" = "Meta+1";
"plasmashell"."activate task manager entry 10" = "none,Meta+0,Activate Task Manager Entry 10"; "plasmashell"."activate task manager entry 10" = "none,Meta+0,Activate Task Manager Entry 10";
"plasmashell"."activate task manager entry 2" = "Meta+2"; "plasmashell"."activate task manager entry 2" = "Meta+2";
@ -228,7 +256,8 @@
}; };
configFile = { configFile = {
"baloofilerc"."General"."dbVersion" = 2; "baloofilerc"."General"."dbVersion" = 2;
"baloofilerc"."General"."exclude filters" = "*~,*.part,*.o,*.la,*.lo,*.loT,*.moc,moc_*.cpp,qrc_*.cpp,ui_*.h,cmake_install.cmake,CMakeCache.txt,CTestTestfile.cmake,libtool,config.status,confdefs.h,autom4te,conftest,confstat,Makefile.am,*.gcode,.ninja_deps,.ninja_log,build.ninja,*.csproj,*.m4,*.rej,*.gmo,*.pc,*.omf,*.aux,*.tmp,*.po,*.vm*,*.nvram,*.rcore,*.swp,*.swap,lzo,litmain.sh,*.orig,.histfile.*,.xsession-errors*,*.map,*.so,*.a,*.db,*.qrc,*.ini,*.init,*.img,*.vdi,*.vbox*,vbox.log,*.qcow2,*.vmdk,*.vhd,*.vhdx,*.sql,*.sql.gz,*.ytdl,*.tfstate*,*.class,*.pyc,*.pyo,*.elc,*.qmlc,*.jsc,*.fastq,*.fq,*.gb,*.fasta,*.fna,*.gbff,*.faa,po,CVS,.svn,.git,_darcs,.bzr,.hg,CMakeFiles,CMakeTmp,CMakeTmpQmake,.moc,.obj,.pch,.uic,.npm,.yarn,.yarn-cache,__pycache__,node_modules,node_packages,nbproject,.terraform,.venv,venv,core-dumps,lost+found"; "baloofilerc"."General"."exclude filters" =
"*~,*.part,*.o,*.la,*.lo,*.loT,*.moc,moc_*.cpp,qrc_*.cpp,ui_*.h,cmake_install.cmake,CMakeCache.txt,CTestTestfile.cmake,libtool,config.status,confdefs.h,autom4te,conftest,confstat,Makefile.am,*.gcode,.ninja_deps,.ninja_log,build.ninja,*.csproj,*.m4,*.rej,*.gmo,*.pc,*.omf,*.aux,*.tmp,*.po,*.vm*,*.nvram,*.rcore,*.swp,*.swap,lzo,litmain.sh,*.orig,.histfile.*,.xsession-errors*,*.map,*.so,*.a,*.db,*.qrc,*.ini,*.init,*.img,*.vdi,*.vbox*,vbox.log,*.qcow2,*.vmdk,*.vhd,*.vhdx,*.sql,*.sql.gz,*.ytdl,*.tfstate*,*.class,*.pyc,*.pyo,*.elc,*.qmlc,*.jsc,*.fastq,*.fq,*.gb,*.fasta,*.fna,*.gbff,*.faa,po,CVS,.svn,.git,_darcs,.bzr,.hg,CMakeFiles,CMakeTmp,CMakeTmpQmake,.moc,.obj,.pch,.uic,.npm,.yarn,.yarn-cache,__pycache__,node_modules,node_packages,nbproject,.terraform,.venv,venv,core-dumps,lost+found";
"baloofilerc"."General"."exclude filters version" = 9; "baloofilerc"."General"."exclude filters version" = 9;
"dolphinrc"."General"."ViewPropsTimestamp" = "2025,1,11,13,50,1.5779999999999998"; "dolphinrc"."General"."ViewPropsTimestamp" = "2025,1,11,13,50,1.5779999999999998";
"dolphinrc"."KFileDialog Settings"."Places Icons Auto-resize" = false; "dolphinrc"."KFileDialog Settings"."Places Icons Auto-resize" = false;
@ -247,7 +276,8 @@
"kwinrc"."Desktops"."Number" = 1; "kwinrc"."Desktops"."Number" = 1;
"kwinrc"."Desktops"."Rows" = 1; "kwinrc"."Desktops"."Rows" = 1;
"kwinrc"."Tiling"."padding" = 4; "kwinrc"."Tiling"."padding" = 4;
"kwinrc"."Tiling/f18ce12b-2106-508f-9542-e4e6c6fbf75f"."tiles" = "{\"layoutDirection\":\"horizontal\",\"tiles\":[{\"width\":0.25},{\"width\":0.5},{\"width\":0.25}]}"; "kwinrc"."Tiling/f18ce12b-2106-508f-9542-e4e6c6fbf75f"."tiles" =
"{\"layoutDirection\":\"horizontal\",\"tiles\":[{\"width\":0.25},{\"width\":0.5},{\"width\":0.25}]}";
"kwinrc"."Xwayland"."Scale" = 1.75; "kwinrc"."Xwayland"."Scale" = 1.75;
"plasma-localerc"."Formats"."LANG" = "en_US.UTF-8"; "plasma-localerc"."Formats"."LANG" = "en_US.UTF-8";
}; };

View file

@ -3,7 +3,8 @@
lib, lib,
config, config,
... ...
}: { }:
{
programs.foot = { programs.foot = {
enable = true; enable = true;
}; };
@ -21,21 +22,21 @@
wayland.windowManager.sway = { wayland.windowManager.sway = {
/* /*
TODO: TODO:
+ Super+r should rotate the selected group of windows. + Super+r should rotate the selected group of windows.
+ Super+Control+{1-9} should control the size of the preselect space. + Super+Control+{1-9} should control the size of the preselect space.
+ Super+Shift+b should balance the size of all selected nodes. + Super+Shift+b should balance the size of all selected nodes.
set $tilers "(wezterm.*|kitty.*|firefox.*|slack.*|Slack.*|thunar.*|Alacritty.*|alacritty.*|Discord.*|discord.*)" set $tilers "(wezterm.*|kitty.*|firefox.*|slack.*|Slack.*|thunar.*|Alacritty.*|alacritty.*|Discord.*|discord.*)"
for_window [title=".*"] floating enable for_window [title=".*"] floating enable
for_window [app_id=$tilers] floating disable for_window [app_id=$tilers] floating disable
# for_window [title=".*"] opacity $opacity # for_window [title=".*"] opacity $opacity
# TODO: I forget why I needed this - could google it I expect? # TODO: I forget why I needed this - could google it I expect?
exec /usr/lib/polkit-kde-authentication-agent-1 exec /usr/lib/polkit-kde-authentication-agent-1
# prevent all windows from stealing focus # prevent all windows from stealing focus
no_focus [class=".*"] no_focus [class=".*"]
*/ */
enable = true; enable = true;
@ -70,9 +71,9 @@
workspaceOutputAssign = [ workspaceOutputAssign = [
/* /*
{ {
output = "eDP"; output = "eDP";
workspace = "1"; workspace = "1";
*/ */
]; ];
@ -100,8 +101,8 @@
}; };
startup = [ startup = [
{command = "kdeconnect-indicator";} { command = "kdeconnect-indicator"; }
{command = "mako";} { command = "mako"; }
{ {
command = "swaybg -i $HOME/.wallpaper"; command = "swaybg -i $HOME/.wallpaper";
} }
@ -175,152 +176,154 @@
# pointer_accel # pointer_accel
}; };
}; };
keybindings = let keybindings =
mod = config.wayland.windowManager.sway.config.modifier; let
menu = "tofi-run | xargs swaymsg exec --"; mod = config.wayland.windowManager.sway.config.modifier;
in { menu = "tofi-run | xargs swaymsg exec --";
"${mod}+control+space" = "exec makoctl dismiss"; in
"${mod}+shift+space" = "exec makoctl invoke"; {
# "${mod}+return" = "exec kitty --single-instance"; "${mod}+control+space" = "exec makoctl dismiss";
"${mod}+return" = "exec wezterm"; "${mod}+shift+space" = "exec makoctl invoke";
"${mod}+shift+return" = "exec floating-term"; # "${mod}+return" = "exec kitty --single-instance";
"${mod}+shift+alt+return" = "exec kitty"; "${mod}+return" = "exec wezterm";
"${mod}+c" = "kill"; "${mod}+shift+return" = "exec floating-term";
"${mod}+shift+c" = "kill # TODO: kill -9?"; "${mod}+shift+alt+return" = "exec kitty";
"${mod}+alt+space" = "exec wofi --show drun"; "${mod}+c" = "kill";
"${mod}" = "exec ${menu}"; "${mod}+shift+c" = "kill # TODO: kill -9?";
"${mod}+space" = "exec ${menu}"; "${mod}+alt+space" = "exec wofi --show drun";
"${mod}+shift+s" = "exec clipshot"; "${mod}" = "exec ${menu}";
"${mod}+e" = "exec thunar"; "${mod}+space" = "exec ${menu}";
"${mod}+shift+r" = "reload"; "${mod}+shift+s" = "exec clipshot";
"${mod}+control+Escape" = "exit"; "${mod}+e" = "exec thunar";
"${mod}+shift+e" = "exit"; "${mod}+shift+r" = "reload";
"${mod}+shift+p" = "exec pass-chooser"; "${mod}+control+Escape" = "exit";
"${mod}+control+j" = "split v"; "${mod}+shift+e" = "exit";
"${mod}+control+l" = "split h"; "${mod}+shift+p" = "exec pass-chooser";
"${mod}+control+f" = "focus mode_toggle"; "${mod}+control+j" = "split v";
"${mod}+control+l" = "split h";
"${mod}+control+f" = "focus mode_toggle";
"${mod}+h" = "focus left"; "${mod}+h" = "focus left";
"${mod}+j" = "focus down"; "${mod}+j" = "focus down";
"${mod}+k" = "focus up"; "${mod}+k" = "focus up";
"${mod}+l" = "focus right"; "${mod}+l" = "focus right";
"${mod}+left" = "focus left"; "${mod}+left" = "focus left";
"${mod}+down" = "focus down"; "${mod}+down" = "focus down";
"${mod}+up" = "focus up"; "${mod}+up" = "focus up";
"${mod}+right" = "focus right"; "${mod}+right" = "focus right";
"${mod}+shift+h" = "move left"; "${mod}+shift+h" = "move left";
"${mod}+shift+j" = "move down"; "${mod}+shift+j" = "move down";
"${mod}+shift+k" = "move up"; "${mod}+shift+k" = "move up";
"${mod}+shift+l" = "move right"; "${mod}+shift+l" = "move right";
"${mod}+shift+left" = "move left"; "${mod}+shift+left" = "move left";
"${mod}+shift+down" = "move down"; "${mod}+shift+down" = "move down";
"${mod}+shift+up" = "move up"; "${mod}+shift+up" = "move up";
"${mod}+shift+right" = "move right"; "${mod}+shift+right" = "move right";
"${mod}+1" = "workspace 1"; "${mod}+1" = "workspace 1";
"${mod}+2" = "workspace 2"; "${mod}+2" = "workspace 2";
"${mod}+3" = "workspace 3"; "${mod}+3" = "workspace 3";
"${mod}+4" = "workspace 4"; "${mod}+4" = "workspace 4";
"${mod}+5" = "workspace 5"; "${mod}+5" = "workspace 5";
"${mod}+6" = "workspace 6"; "${mod}+6" = "workspace 6";
"${mod}+7" = "workspace 7"; "${mod}+7" = "workspace 7";
"${mod}+8" = "workspace 8"; "${mod}+8" = "workspace 8";
"${mod}+9" = "workspace 9"; "${mod}+9" = "workspace 9";
"${mod}+0" = "workspace 10"; "${mod}+0" = "workspace 10";
"${mod}+shift+1" = "move container to workspace 1"; "${mod}+shift+1" = "move container to workspace 1";
"${mod}+shift+2" = "move container to workspace 2"; "${mod}+shift+2" = "move container to workspace 2";
"${mod}+shift+3" = "move container to workspace 3"; "${mod}+shift+3" = "move container to workspace 3";
"${mod}+shift+4" = "move container to workspace 4"; "${mod}+shift+4" = "move container to workspace 4";
"${mod}+shift+5" = "move container to workspace 5"; "${mod}+shift+5" = "move container to workspace 5";
"${mod}+shift+6" = "move container to workspace 6"; "${mod}+shift+6" = "move container to workspace 6";
"${mod}+shift+7" = "move container to workspace 7"; "${mod}+shift+7" = "move container to workspace 7";
"${mod}+shift+8" = "move container to workspace 8"; "${mod}+shift+8" = "move container to workspace 8";
"${mod}+shift+9" = "move container to workspace 9"; "${mod}+shift+9" = "move container to workspace 9";
"${mod}+shift+0" = "move container to workspace 10"; "${mod}+shift+0" = "move container to workspace 10";
"${mod}+b" = "splith"; "${mod}+b" = "splith";
"${mod}+v" = "splitv"; "${mod}+v" = "splitv";
"${mod}+shift+f" = "fullscreen toggle"; "${mod}+shift+f" = "fullscreen toggle";
"${mod}+f" = "floating toggle"; "${mod}+f" = "floating toggle";
"${mod}+s" = "floating disable"; "${mod}+s" = "floating disable";
"${mod}+alt+f" = "focus mode_toggle"; "${mod}+alt+f" = "focus mode_toggle";
"${mod}+p" = "focus parent"; "${mod}+p" = "focus parent";
"${mod}+period" = "focus child"; "${mod}+period" = "focus child";
"${mod}+comma" = "focus child"; "${mod}+comma" = "focus child";
"${mod}+tab" = "workspace back_and_forth"; "${mod}+tab" = "workspace back_and_forth";
"alt+tab" = "workspace back_and_forth"; "alt+tab" = "workspace back_and_forth";
"${mod}+minus" = "gaps inner current minus 5"; "${mod}+minus" = "gaps inner current minus 5";
"${mod}+plus" = "gaps inner current plus 5"; "${mod}+plus" = "gaps inner current plus 5";
"${mod}+control+alt+h" = "gaps horizontal current minus 5"; "${mod}+control+alt+h" = "gaps horizontal current minus 5";
"${mod}+control+alt+l" = "gaps horizontal current plus 5"; "${mod}+control+alt+l" = "gaps horizontal current plus 5";
"${mod}+control+alt+j" = "gaps vertical current minus 5"; "${mod}+control+alt+j" = "gaps vertical current minus 5";
"${mod}+control+alt+k" = "gaps vertical current plus 5"; "${mod}+control+alt+k" = "gaps vertical current plus 5";
# TODO: this should also reset the horizontal and vertical gaps? # TODO: this should also reset the horizontal and vertical gaps?
"${mod}+control+equal" = "gaps inner current set 0"; "${mod}+control+equal" = "gaps inner current set 0";
"${mod}+shift+v" = "exec swayosd-client --input-volume mute-toggle"; "${mod}+shift+v" = "exec swayosd-client --input-volume mute-toggle";
"${mod}+F1" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; "${mod}+F1" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise"; "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise";
"XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower"; "XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower";
"XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle"; "XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle";
"XF86AudioMicMute" = "exec swayosd-client --input-volume mute-toggle"; "XF86AudioMicMute" = "exec swayosd-client --input-volume mute-toggle";
"XF86MonBrightnessUp" = "exec swayosd-client --brightness raise"; "XF86MonBrightnessUp" = "exec swayosd-client --brightness raise";
"XF86MonBrightnessDown" = "exec swayosd-client --brightness lower"; "XF86MonBrightnessDown" = "exec swayosd-client --brightness lower";
"control+XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%"; "control+XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%";
"control+XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%"; "control+XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%";
"XF86AudioPlay" = "exec playerctl play-pause"; "XF86AudioPlay" = "exec playerctl play-pause";
"XF86AudioNext" = "exec playerctl next"; "XF86AudioNext" = "exec playerctl next";
"XF86AudioPrev" = "exec playerctl previous"; "XF86AudioPrev" = "exec playerctl previous";
"--locked ${mod}+shift+v" = "exec swayosd-client --input-volume mute-toggle"; "--locked ${mod}+shift+v" = "exec swayosd-client --input-volume mute-toggle";
"--locked ${mod}+F1" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; "--locked ${mod}+F1" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
"--locked XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise"; "--locked XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise";
"--locked XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower"; "--locked XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower";
"--locked XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle"; "--locked XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle";
"--locked XF86AudioMicMute" = "exec swayosd-client --input-volume mute-toggle"; "--locked XF86AudioMicMute" = "exec swayosd-client --input-volume mute-toggle";
"--locked XF86MonBrightnessUp" = "exec swayosd-client --brightness raise"; "--locked XF86MonBrightnessUp" = "exec swayosd-client --brightness raise";
"--locked XF86MonBrightnessDown" = "exec swayosd-client --brightness lower"; "--locked XF86MonBrightnessDown" = "exec swayosd-client --brightness lower";
"--locked control+XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%"; "--locked control+XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%";
"--locked control+XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%"; "--locked control+XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%";
"--locked XF86AudioPlay" = "exec playerctl play-pause"; "--locked XF86AudioPlay" = "exec playerctl play-pause";
"--locked XF86AudioNext" = "exec playerctl next"; "--locked XF86AudioNext" = "exec playerctl next";
"--locked XF86AudioPrev" = "exec playerctl previous"; "--locked XF86AudioPrev" = "exec playerctl previous";
/* /*
"XF86MonBrightnessUp" = " exec swayosd-client --brightness 10"; "XF86MonBrightnessUp" = " exec swayosd-client --brightness 10";
"XF86MonBrightnessDown" = "exec swayosd-client --brightness -10"; "XF86MonBrightnessDown" = "exec swayosd-client --brightness -10";
"XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%"; "XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%";
"XF86AudioRaiseVolume" = "exec swayosd-client --output-volume 15"; "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume 15";
"XF86AudioLowerVolume" = "exec swayosd-client --output-volume -15"; "XF86AudioLowerVolume" = "exec swayosd-client --output-volume -15";
"XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise --max-volume 120"; "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise --max-volume 120";
"XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower --max-volume 120"; "XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower --max-volume 120";
"XF86AudioRaiseVolume" = "exec swayosd-client --output-volume +10 --device alsa_output.pci-0000_11_00.4.analog-stereo.monitor"; "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume +10 --device alsa_output.pci-0000_11_00.4.analog-stereo.monitor";
"XF86AudioLowerVolume" = "exec swayosd-client --output-volume -10 --device alsa_output.pci-0000_11_00.4.analog-stereo.monitor"; "XF86AudioLowerVolume" = "exec swayosd-client --output-volume -10 --device alsa_output.pci-0000_11_00.4.analog-stereo.monitor";
"XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; "XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
"XF86MonBrightnessDown" = "exec brightnessctl set 10%-"; "XF86MonBrightnessDown" = "exec brightnessctl set 10%-";
"XF86MonBrightnessUp" = "exec brightnessctl set +10%"; "XF86MonBrightnessUp" = "exec brightnessctl set +10%";
"shift+XF86MonBrightnessDown" = "exec brightnessctl set 1%"; "shift+XF86MonBrightnessDown" = "exec brightnessctl set 1%";
"shift+XF86MonBrightnessUp" = "exec brightnessctl set 100%"; "shift+XF86MonBrightnessUp" = "exec brightnessctl set 100%";
"control+XF86MonBrightnessDown" = "exec brightnessctl set 1%-"; "control+XF86MonBrightnessDown" = "exec brightnessctl set 1%-";
"control+XF86MonBrightnessUp" = "exec brightnessctl set +1%"; "control+XF86MonBrightnessUp" = "exec brightnessctl set +1%";
"${mod}+shift+v" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; "${mod}+shift+v" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
*/ */
"${mod}+control+shift+l" = "exec swaylock"; "${mod}+control+shift+l" = "exec swaylock";
"${mod}+shift+alt+f" = "for_window [class=$tilers] floating toggle"; "${mod}+shift+alt+f" = "for_window [class=$tilers] floating toggle";
}; };
assigns = {}; assigns = { };
bars = []; bars = [ ];
colors = with style.colors; { colors = with style.colors; {
background = bg; background = bg;
focused = { focused = {
@ -364,55 +367,55 @@
# this doesn't work due to weird quoting bugs AFAICT # this doesn't work due to weird quoting bugs AFAICT
/* /*
services.swayidle = let services.swayidle = let
bins = rec { bins = rec {
swaylock = builtins.trace "${pkgs.swaylock}/bin/swaylock" "${pkgs.swaylock}/bin/swaylock"; swaylock = builtins.trace "${pkgs.swaylock}/bin/swaylock" "${pkgs.swaylock}/bin/swaylock";
swaymsg = "${pkgs.sway}/bin/swaymsg"; swaymsg = "${pkgs.sway}/bin/swaymsg";
notify-send = "${swaymsg} exec -- ${pkgs.libnotify}/bin/notify-send"; notify-send = "${swaymsg} exec -- ${pkgs.libnotify}/bin/notify-send";
}; };
in (with bins; { in (with bins; {
enable = true; enable = true;
events = [ events = [
{ {
event = "before-sleep"; event = "before-sleep";
command = swaylock; command = swaylock;
} }
]; ];
timeouts = [ timeouts = [
{ {
timeout = 5; timeout = 5;
command = "${notify-send} \\\"Idling in 300 seconds\\\""; command = "${notify-send} \\\"Idling in 300 seconds\\\"";
resumeCommand = "${notify-send} \\\"Idling cancelled.\\\""; resumeCommand = "${notify-send} \\\"Idling cancelled.\\\"";
} }
{ {
# timeout = 540; # timeout = 540;
timeout = 6; timeout = 6;
command = "${notify-send} 'Idling in 90 seconds'"; command = "${notify-send} 'Idling in 90 seconds'";
} }
{ {
# timeout = 570; # timeout = 570;
timeout = 7; timeout = 7;
command = "${notify-send} 'Idling in 60 seconds'"; command = "${notify-send} 'Idling in 60 seconds'";
} }
{ {
# timeout = 600; # timeout = 600;
timeout = 8; timeout = 8;
command = "${notify-send} 'Idling in 30 seconds...'"; command = "${notify-send} 'Idling in 30 seconds...'";
} }
{ {
# timeout = 630; # timeout = 630;
timeout = 9; timeout = 9;
command = "${swaylock} -f"; command = "${swaylock} -f";
} }
{ {
# timeout = 660; # timeout = 660;
timeout = 10; timeout = 10;
command = "${swaymsg} 'output * dpms off'"; command = "${swaymsg} 'output * dpms off'";
resumeCommand = "${swaymsg} 'output * dpms on' & ${swaymsg} exec -- maybe-good-morning &"; resumeCommand = "${swaymsg} 'output * dpms on' & ${swaymsg} exec -- maybe-good-morning &";
} }
]; ];
}); });
*/ */
} }

View file

@ -1,4 +1,5 @@
{style, ...}: { { style, ... }:
{
programs.swaylock = { programs.swaylock = {
enable = true; enable = true;
settings = { settings = {

View file

@ -2,21 +2,25 @@
pkgs, pkgs,
style, style,
... ...
}: { }:
{
programs.waybar = { programs.waybar = {
enable = true; enable = true;
settings = { settings = {
mainBar = { mainBar = {
"layer" = "top"; "layer" = "top";
"position" = "bottom"; "position" = "bottom";
"output" = ["eDP-1" "DP-3"]; "output" = [
"eDP-1"
"DP-3"
];
"height" = 50; "height" = 50;
"modules-left" = [ "modules-left" = [
"idle_inhibitor" "idle_inhibitor"
"sway/workspaces" "sway/workspaces"
"sway/window" "sway/window"
]; ];
"modules-center" = []; "modules-center" = [ ];
"modules-right" = [ "modules-right" = [
"privacy" "privacy"
"power-profiles-daemon" "power-profiles-daemon"
@ -83,9 +87,9 @@
}; };
"temperature" = { "temperature" = {
/* /*
"thermal-zone" = 2; "thermal-zone" = 2;
"hwmon-path" = "/sys/class/hwmon/hwmon2/temp1_input"; "hwmon-path" = "/sys/class/hwmon/hwmon2/temp1_input";
"format-critical" = "{temperatureC}°C {icon}"; "format-critical" = "{temperatureC}°C {icon}";
*/ */
"critical-threshold" = 80; "critical-threshold" = 80;
"format" = "{temperatureC}\n°C"; "format" = "{temperatureC}\n°C";
@ -94,7 +98,10 @@
"backlight" = { "backlight" = {
# "device" = "acpi_video1"; # "device" = "acpi_video1";
"format" = "{percent}%\n{icon}"; "format" = "{percent}%\n{icon}";
"format-icons" = ["" ""]; "format-icons" = [
""
""
];
"justify" = "center"; "justify" = "center";
}; };
"battery" = { "battery" = {
@ -129,9 +136,9 @@
}; };
"pulseaudio" = { "pulseaudio" = {
/* /*
"scroll-step" = 1, # %, can be a floa; "scroll-step" = 1, # %, can be a floa;
"format" = "{volume}% {icon} {format_source}"; "format" = "{volume}% {icon} {format_source}";
"format-muted" = " {format_source}"; "format-muted" = " {format_source}";
*/ */
"format" = "{volume}%\n{format_source}"; "format" = "{volume}%\n{format_source}";
"format-muted" = "MUTE\n{format_source}"; "format-muted" = "MUTE\n{format_source}";
@ -145,10 +152,12 @@
}; };
}; };
}; };
style = let style =
border-width = "0px"; let
in border-width = "0px";
with style.colors.withHashPrefix; '' in
with style.colors.withHashPrefix;
''
* { * {
border-radius: 0; border-radius: 0;
font-family: "${style.font.name}", "Symbols Nerd Font Mono", sans-serif; font-family: "${style.font.name}", "Symbols Nerd Font Mono", sans-serif;

View file

@ -4,14 +4,16 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.services.conduwuit; cfg = config.services.conduwuit;
defaultUser = "conduwuit"; defaultUser = "conduwuit";
defaultGroup = "conduwuit"; defaultGroup = "conduwuit";
format = pkgs.formats.toml {}; format = pkgs.formats.toml { };
configFile = format.generate "conduwuit.toml" cfg.settings; configFile = format.generate "conduwuit.toml" cfg.settings;
in { in
meta.maintainers = with lib.maintainers; [niklaskorz]; {
meta.maintainers = with lib.maintainers; [ niklaskorz ];
options.services.conduwuit = { options.services.conduwuit = {
enable = lib.mkEnableOption "conduwuit"; enable = lib.mkEnableOption "conduwuit";
@ -34,13 +36,13 @@ in {
extraEnvironment = lib.mkOption { extraEnvironment = lib.mkOption {
type = lib.types.attrsOf lib.types.str; type = lib.types.attrsOf lib.types.str;
description = "Extra Environment variables to pass to the conduwuit server."; description = "Extra Environment variables to pass to the conduwuit server.";
default = {}; default = { };
example = { example = {
RUST_BACKTRACE = "yes"; RUST_BACKTRACE = "yes";
}; };
}; };
package = lib.mkPackageOption pkgs.unstable-packages "conduwuit" {}; package = lib.mkPackageOption pkgs.unstable-packages "conduwuit" { };
settings = lib.mkOption { settings = lib.mkOption {
type = lib.types.submodule { type = lib.types.submodule {
@ -66,7 +68,7 @@ in {
}; };
global.port = lib.mkOption { global.port = lib.mkOption {
type = lib.types.listOf lib.types.port; type = lib.types.listOf lib.types.port;
default = [6167]; default = [ 6167 ];
description = '' description = ''
The port(s) conduwuit will be running on. The port(s) conduwuit will be running on.
You need to set up a reverse proxy in your web server (e.g. apache or nginx), You need to set up a reverse proxy in your web server (e.g. apache or nginx),
@ -125,7 +127,7 @@ in {
}; };
global.trusted_servers = lib.mkOption { global.trusted_servers = lib.mkOption {
type = lib.types.listOf lib.types.nonEmptyStr; type = lib.types.listOf lib.types.nonEmptyStr;
default = ["matrix.org"]; default = [ "matrix.org" ];
description = '' description = ''
Servers listed here will be used to gather public keys of other servers Servers listed here will be used to gather public keys of other servers
(notary trusted key servers). (notary trusted key servers).
@ -158,7 +160,7 @@ in {
}; };
}; };
}; };
default = {}; default = { };
# TOML does not allow null values, so we use null to omit those fields # TOML does not allow null values, so we use null to omit those fields
apply = lib.filterAttrsRecursive (_: v: v != null); apply = lib.filterAttrsRecursive (_: v: v != null);
description = '' description = ''
@ -198,17 +200,17 @@ in {
}; };
users.groups = lib.mkIf (cfg.group == defaultGroup) { users.groups = lib.mkIf (cfg.group == defaultGroup) {
${defaultGroup} = {}; ${defaultGroup} = { };
}; };
systemd.services.conduwuit = { systemd.services.conduwuit = {
description = "Conduwuit Matrix Server"; description = "Conduwuit Matrix Server";
documentation = ["https://conduwuit.puppyirl.gay/"]; documentation = [ "https://conduwuit.puppyirl.gay/" ];
wantedBy = ["multi-user.target"]; wantedBy = [ "multi-user.target" ];
wants = ["network-online.target"]; wants = [ "network-online.target" ];
after = ["network-online.target"]; after = [ "network-online.target" ];
environment = lib.mkMerge [ environment = lib.mkMerge [
{CONDUWUIT_CONFIG = configFile;} { CONDUWUIT_CONFIG = configFile; }
cfg.extraEnvironment cfg.extraEnvironment
]; ];
startLimitBurst = 5; startLimitBurst = 5;

File diff suppressed because it is too large Load diff

View file

@ -3,11 +3,18 @@
config, config,
pkgs, pkgs,
... ...
}: let }:
inherit (lib) mkEnableOption mkOption types mkIf; let
inherit (lib)
mkEnableOption
mkOption
types
mkIf
;
inherit (lib.strings) optionalString; inherit (lib.strings) optionalString;
cfg = config.services.deno-netlify-ddns-client; cfg = config.services.deno-netlify-ddns-client;
in { in
{
options.services.deno-netlify-ddns-client = { options.services.deno-netlify-ddns-client = {
enable = mkEnableOption "Enable the deno-netlify-ddns client."; enable = mkEnableOption "Enable the deno-netlify-ddns client.";
username = mkOption { username = mkOption {
@ -48,8 +55,8 @@ in {
config = { config = {
systemd.timers.deno-netlify-ddns-client = { systemd.timers.deno-netlify-ddns-client = {
enable = mkIf cfg.enable true; enable = mkIf cfg.enable true;
after = ["network.target"]; after = [ "network.target" ];
wantedBy = ["timers.target"]; wantedBy = [ "timers.target" ];
timerConfig = { timerConfig = {
OnBootSec = cfg.afterBootTime; OnBootSec = cfg.afterBootTime;
OnUnitActiveSec = cfg.every; OnUnitActiveSec = cfg.every;
@ -59,7 +66,7 @@ in {
systemd.services.deno-netlify-ddns-client = { systemd.services.deno-netlify-ddns-client = {
enable = mkIf cfg.enable true; enable = mkIf cfg.enable true;
after = ["network.target"]; after = [ "network.target" ];
script = '' script = ''
set -eu set -eu
password="$(cat "${cfg.passwordFile}")" password="$(cat "${cfg.passwordFile}")"

View file

@ -2,8 +2,9 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }:
imports = [./pipewire.nix]; {
imports = [ ./pipewire.nix ];
# mkForce is used liberally to take precedence over KDE Plasma # mkForce is used liberally to take precedence over KDE Plasma
# so I can have both "usable" at once # so I can have both "usable" at once
@ -21,7 +22,7 @@
services.xserver.desktopManager.gnome = { services.xserver.desktopManager.gnome = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
extraGSettingsOverridePackages = [pkgs.gnome.mutter]; extraGSettingsOverridePackages = [ pkgs.gnome.mutter ];
extraGSettingsOverrides = '' extraGSettingsOverrides = ''
[org.gnome.mutter] [org.gnome.mutter]
experimental-features=['scale-monitor-framebuffer'] experimental-features=['scale-monitor-framebuffer']
@ -65,18 +66,18 @@
wl-clipboard wl-clipboard
zathura zathura
/* /*
gimp gimp
inkscape inkscape
krita krita
pavucontrol pavucontrol
pulseaudio pulseaudio
rclone rclone
restic restic
steam steam
vlc vlc
vulkan-tools vulkan-tools
weechat weechat
wine wine
*/ */
]; ];
}; };

View file

@ -3,9 +3,11 @@
pkgs, pkgs,
config, config,
... ...
}: let }:
let
cfg = config.lyte.shell; cfg = config.lyte.shell;
in { in
{
options = { options = {
lyte = { lyte = {
shell = { shell = {

View file

@ -3,7 +3,8 @@
nixpkgs, nixpkgs,
nixpkgs-unstable, nixpkgs-unstable,
... ...
} @ inputs: { }@inputs:
{
default = final: _prev: { default = final: _prev: {
overlays = with self.overlays; [ overlays = with self.overlays; [
additions additions
@ -14,13 +15,16 @@
additions = final: prev: (prev // self.outputs.packages.${prev.system}); additions = final: prev: (prev // self.outputs.packages.${prev.system});
modifications = final: prev: let modifications =
inherit (inputs) helix ghostty; final: prev:
in { let
ghostty = ghostty.outputs.packages.${prev.system}.default; inherit (inputs) helix ghostty;
helix = helix.outputs.packages.${prev.system}.default; in
bitwarden = self.outputs.packages.${prev.system}.bitwarden; {
}; ghostty = ghostty.outputs.packages.${prev.system}.default;
helix = helix.outputs.packages.${prev.system}.default;
bitwarden = self.outputs.packages.${prev.system}.bitwarden;
};
unstable-packages = final: _prev: { unstable-packages = final: _prev: {
unstable-packages = import nixpkgs-unstable { unstable-packages = import nixpkgs-unstable {

View file

@ -1,34 +1,41 @@
{ {
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { outputs =
self, {
nixpkgs, self,
}: let nixpkgs,
inherit (self) outputs; }:
supportedSystems = [ let
"x86_64-linux" inherit (self) outputs;
"aarch64-linux" supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin" "x86_64-darwin"
"aarch64-darwin" "aarch64-darwin"
]; ];
forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems; forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems;
in { in
devShells = forEachSupportedSystem (system: let {
pkgs = import nixpkgs {inherit system;}; devShells = forEachSupportedSystem (
in { system:
deno-dev = pkgs.mkShell { let
buildInputs = with pkgs; [ pkgs = import nixpkgs { inherit system; };
vscode-langservers-extracted in
deno {
curl deno-dev = pkgs.mkShell {
xh buildInputs = with pkgs; [
sqlite vscode-langservers-extracted
]; deno
}; curl
xh
sqlite
];
};
default = outputs.devShells.${system}.deno-dev; default = outputs.devShells.${system}.deno-dev;
}); }
}; );
};
} }

View file

@ -5,12 +5,15 @@
git-hooks.inputs.nixpkgs.follows = "nixpkgs"; git-hooks.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = inputs: let outputs =
inherit (import nix/boilerplate.nix inputs) call; inputs:
in { let
overlays = import nix/overlays.nix; inherit (import nix/boilerplate.nix inputs) call;
packages = call (import nix/packages.nix); in
checks = call (import nix/checks.nix); {
devShells = call (import nix/shells.nix); overlays = import nix/overlays.nix;
}; packages = call (import nix/packages.nix);
checks = call (import nix/checks.nix);
devShells = call (import nix/shells.nix);
};
} }

View file

@ -1,16 +1,21 @@
inputs @ { inputs@{
nixpkgs, nixpkgs,
self, self,
... ...
}: let }:
let
forSelfOverlay = forSelfOverlay =
if builtins.hasAttr "forSelf" self.overlays if builtins.hasAttr "forSelf" self.overlays then self.overlays.forSelf else (_: p: p);
then self.overlays.forSelf in
else (_: p: p); rec {
in rec { systems = [
systems = ["aarch64-linux" "x86_64-linux" "x86_64-darwin" "aarch64-darwin"]; "aarch64-linux"
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forSystems = nixpkgs.lib.genAttrs systems; forSystems = nixpkgs.lib.genAttrs systems;
pkgsFor = system: ((import nixpkgs {inherit system;}).extend forSelfOverlay); pkgsFor = system: ((import nixpkgs { inherit system; }).extend forSelfOverlay);
genPkgs = func: (forSystems (system: func (pkgsFor system))); genPkgs = func: (forSystems (system: func (pkgsFor system)));
call = imported: genPkgs (pkgs: imported (inputs // {inherit pkgs;})); call = imported: genPkgs (pkgs: imported (inputs // { inherit pkgs; }));
} }

View file

@ -2,28 +2,32 @@
git-hooks, git-hooks,
pkgs, pkgs,
... ...
}: let }:
hook = { let
command, hook =
stages ? ["pre-commit"], {
... command,
}: { stages ? [ "pre-commit" ],
inherit stages; ...
enable = true; }:
name = command; {
entry = command; inherit stages;
pass_filenames = false; enable = true;
}; name = command;
in { entry = command;
pass_filenames = false;
};
in
{
git-hooks = git-hooks.lib.${pkgs.system}.run { git-hooks = git-hooks.lib.${pkgs.system}.run {
src = ./..; src = ./..;
hooks = { hooks = {
alejandra.enable = true; alejandra.enable = true;
convco.enable = true; convco.enable = true;
credo = hook {command = "mix credo --strict";}; credo = hook { command = "mix credo --strict"; };
formatting = hook {command = "mix format --check-formatted";}; formatting = hook { command = "mix format --check-formatted"; };
dialyzer = hook {command = "mix dialyzer";}; dialyzer = hook { command = "mix dialyzer"; };
test = hook {command = "mix test";}; test = hook { command = "mix test"; };
}; };
}; };
} }

View file

@ -2,8 +2,8 @@
forSelf = final: prev: { forSelf = final: prev: {
erlang = prev.beam.packagesWith prev.beam.interpreters.erlang_27; erlang = prev.beam.packagesWith prev.beam.interpreters.erlang_27;
elixir = final.erlang.elixir_1_17; elixir = final.erlang.elixir_1_17;
mixRelease = final.erlang.mixRelease.override {elixir = final.elixir;}; mixRelease = final.erlang.mixRelease.override { elixir = final.elixir; };
fetchMixDeps = final.erlang.fetchMixDeps.override {elixir = final.elixir;}; fetchMixDeps = final.erlang.fetchMixDeps.override { elixir = final.elixir; };
elixir-ls = prev.elixir-ls.override {elixir = final.elixir;}; elixir-ls = prev.elixir-ls.override { elixir = final.elixir; };
}; };
} }

View file

@ -2,11 +2,13 @@
pkgs, pkgs,
self, self,
... ...
}: let }:
let
version = "1.0.0"; version = "1.0.0";
src = ../.; src = ../.;
pname = "my-package"; pname = "my-package";
in { in
{
${pname} = pkgs.mixRelease { ${pname} = pkgs.mixRelease {
inherit pname version src; inherit pname version src;
mixFodDeps = pkgs.fetchMixDeps { mixFodDeps = pkgs.fetchMixDeps {

View file

@ -2,7 +2,8 @@
pkgs, pkgs,
self, self,
... ...
}: { }:
{
elixir-dev = pkgs.mkShell { elixir-dev = pkgs.mkShell {
shellHook = '' shellHook = ''
${self.checks.${pkgs.system}.git-hooks.shellHook} ${self.checks.${pkgs.system}.git-hooks.shellHook}

View file

@ -1,27 +1,35 @@
{ {
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
outputs = { outputs =
self, {
nixpkgs, self,
... nixpkgs,
}: let ...
systems = ["aarch64-linux" "x86_64-linux" "x86_64-darwin" "aarch64-darwin"]; }:
forSystems = nixpkgs.lib.genAttrs systems; let
pkgsFor = system: (import nixpkgs {inherit system;}).extend self.outputs.overlays.default; systems = [
genPkgs = func: (forSystems (system: func (pkgsFor system))); "aarch64-linux"
in { "x86_64-linux"
overlays.default = final: prev: { "x86_64-darwin"
erlangPackages = prev.beam.packagesWith prev.erlang_27; "aarch64-darwin"
erlang = final.erlangPackages.erlang; ];
}; forSystems = nixpkgs.lib.genAttrs systems;
devShells = genPkgs (pkgs: { pkgsFor = system: (import nixpkgs { inherit system; }).extend self.outputs.overlays.default;
default = pkgs.mkShell { genPkgs = func: (forSystems (system: func (pkgsFor system)));
buildInputs = with pkgs; [ in
erlang {
gleam overlays.default = final: prev: {
rebar3 erlangPackages = prev.beam.packagesWith prev.erlang_27;
]; erlang = final.erlangPackages.erlang;
}; };
}); devShells = genPkgs (pkgs: {
}; default = pkgs.mkShell {
buildInputs = with pkgs; [
erlang
gleam
rebar3
];
};
});
};
} }

View file

@ -1,32 +1,42 @@
{ {
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = { outputs =
self, {
nixpkgs, self,
... nixpkgs,
}: let ...
inherit (self) outputs; }:
supportedSystems = [ let
"x86_64-linux" inherit (self) outputs;
"aarch64-linux" supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin" "x86_64-darwin"
"aarch64-darwin" "aarch64-darwin"
]; ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems; forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in { in
devShells = forAllSystems (system: let {
pkgs = import nixpkgs {inherit system;}; devShells = forAllSystems (
in { system:
default = outputs.devShells.${system}.godot; let
godot = pkgs.mkShell { pkgs = import nixpkgs { inherit system; };
buildInputs = with pkgs; [godot_4 gdtoolkit]; in
shellHook = '' {
echo -e "\e[0;30m\e[43m Use 'godot4 -e' to run the editor for this project. \e[0;30m\e[0m" default = outputs.devShells.${system}.godot;
''; godot = pkgs.mkShell {
}; buildInputs = with pkgs; [
}); godot_4
}; gdtoolkit
];
shellHook = ''
echo -e "\e[0;30m\e[43m Use 'godot4 -e' to run the editor for this project. \e[0;30m\e[0m"
'';
};
}
);
};
} }

View file

@ -1,31 +1,38 @@
{ {
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { outputs =
self, {
nixpkgs, self,
}: let nixpkgs,
inherit (self) outputs; }:
supportedSystems = [ let
"x86_64-linux" inherit (self) outputs;
"aarch64-linux" supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin" "x86_64-darwin"
"aarch64-darwin" "aarch64-darwin"
]; ];
forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems; forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems;
in { in
devShells = forEachSupportedSystem (system: let {
pkgs = import nixpkgs {inherit system;}; devShells = forEachSupportedSystem (
in { system:
nim-dev = pkgs.mkShell { let
buildInputs = with pkgs; [ pkgs = import nixpkgs { inherit system; };
nim in
nimble {
nimlangserver nim-dev = pkgs.mkShell {
]; buildInputs = with pkgs; [
}; nim
nimble
nimlangserver
];
};
default = outputs.devShells.${system}.nim-dev; default = outputs.devShells.${system}.nim-dev;
}); }
}; );
};
} }

View file

@ -2,13 +2,16 @@
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.git-hooks.url = "github:cachix/git-hooks.nix"; inputs.git-hooks.url = "github:cachix/git-hooks.nix";
inputs.git-hooks.inputs.nixpkgs.follows = "nixpkgs"; inputs.git-hooks.inputs.nixpkgs.follows = "nixpkgs";
outputs = inputs: let outputs =
inherit (import nix/boilerplate.nix inputs) call genPkgs; inputs:
in { let
# overlays = import nix/overlays.nix; inherit (import nix/boilerplate.nix inputs) call genPkgs;
checks = call (import nix/checks.nix); in
packages = call (import nix/packages.nix); {
devShells = call (import nix/shells.nix); # overlays = import nix/overlays.nix;
formatter = genPkgs (p: p.alejandra); checks = call (import nix/checks.nix);
}; packages = call (import nix/packages.nix);
devShells = call (import nix/shells.nix);
formatter = genPkgs (p: p.alejandra);
};
} }

View file

@ -1,16 +1,24 @@
inputs @ { inputs@{
nixpkgs, nixpkgs,
self, self,
... ...
}: let }:
let
forSelfOverlay = forSelfOverlay =
if builtins.hasAttr "overlays" self && builtins.hasAttr "forSelf" self.overlays if builtins.hasAttr "overlays" self && builtins.hasAttr "forSelf" self.overlays then
then self.overlays.forSelf self.overlays.forSelf
else (_: p: p); else
in rec { (_: p: p);
systems = ["aarch64-linux" "x86_64-linux" "x86_64-darwin" "aarch64-darwin"]; in
rec {
systems = [
"aarch64-linux"
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forSystems = nixpkgs.lib.genAttrs systems; forSystems = nixpkgs.lib.genAttrs systems;
pkgsFor = system: ((import nixpkgs {inherit system;}).extend forSelfOverlay); pkgsFor = system: ((import nixpkgs { inherit system; }).extend forSelfOverlay);
genPkgs = func: (forSystems (system: func (pkgsFor system))); genPkgs = func: (forSystems (system: func (pkgsFor system)));
call = imported: genPkgs (pkgs: imported (inputs // {inherit pkgs;})); call = imported: genPkgs (pkgs: imported (inputs // { inherit pkgs; }));
} }

View file

@ -2,7 +2,8 @@
pkgs, pkgs,
git-hooks, git-hooks,
... ...
}: { }:
{
git-hooks = git-hooks.lib.${pkgs.system}.run { git-hooks = git-hooks.lib.${pkgs.system}.run {
src = ./..; src = ./..;
hooks = { hooks = {
@ -16,7 +17,7 @@
# types = ["rust"]; # types = ["rust"];
# language = "rust"; # language = "rust";
pass_filenames = false; pass_filenames = false;
stages = ["pre-commit"]; stages = [ "pre-commit" ];
}; };
clippy.enable = true; clippy.enable = true;
rustfmt.enable = true; rustfmt.enable = true;

View file

@ -1,4 +1,5 @@
{pkgs, ...}: let { pkgs, ... }:
let
inherit (builtins) fromTOML readFile; inherit (builtins) fromTOML readFile;
pname = "my-package"; pname = "my-package";
src = ./..; src = ./..;
@ -8,19 +9,20 @@
# or for workspaces: version = (fromTOML (readFile "${src}/${pname}/Cargo.toml")).package.version; # or for workspaces: version = (fromTOML (readFile "${src}/${pname}/Cargo.toml")).package.version;
/* /*
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
pkg-config pkg-config
clang clang
]; ];
buildInputs = with pkgs; [ buildInputs = with pkgs; [
]; ];
*/ */
cargoHash = pkgs.lib.fakeHash; cargoHash = pkgs.lib.fakeHash;
useFetchCargoVendor = true; useFetchCargoVendor = true;
}; };
in { in
{
${pname} = main-package; ${pname} = main-package;
default = main-package; default = main-package;
} }

View file

@ -2,12 +2,14 @@
self, self,
pkgs, pkgs,
... ...
}: let }:
let
inherit (pkgs) system; inherit (pkgs) system;
in { in
{
default = pkgs.mkShell { default = pkgs.mkShell {
inherit (self.checks.${system}.git-hooks) shellHook; inherit (self.checks.${system}.git-hooks) shellHook;
inputsFrom = [self.packages.${system}.default]; inputsFrom = [ self.packages.${system}.default ];
packages = with pkgs; [ packages = with pkgs; [
convco convco
rustPackages.clippy rustPackages.clippy

View file

@ -1 +0,0 @@

View file

@ -1,6 +1,7 @@
{nixpkgs, ...}: { { nixpkgs, ... }:
{
style = { style = {
colors = (import ./lib/colors.nix {inherit (nixpkgs) lib;}).schemes.catppuccin-mocha-sapphire; colors = (import ./lib/colors.nix { inherit (nixpkgs) lib; }).schemes.catppuccin-mocha-sapphire;
font = { font = {
name = "IosevkaLyteTerm"; name = "IosevkaLyteTerm";
@ -9,11 +10,11 @@
}; };
/* /*
moduleArgs = { moduleArgs = {
# inherit style; # inherit style;
inherit helix slippi hyprland hardware disko home-manager; inherit helix slippi hyprland hardware disko home-manager;
inherit (outputs) nixosModules homeManagerModules diskoConfigurations overlays; inherit (outputs) nixosModules homeManagerModules diskoConfigurations overlays;
}; };
*/ */
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev"; pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev";

View file

@ -1,438 +1,438 @@
{
beefcake =
let
system = "x86_64-linux";
in
nixpkgs.lib.nixosSystem {
inherit system;
modules = with nixosModules; [
home-manager-defaults
conduwuit
beefcake = let # TODO: disko?
system = "x86_64-linux"; hardware.nixosModules.common-cpu-intel
in
nixpkgs.lib.nixosSystem {
inherit system;
modules = with nixosModules; [
home-manager-defaults
conduwuit
# TODO: disko? outputs.nixosModules.deno-netlify-ddns-client
hardware.nixosModules.common-cpu-intel {
services.deno-netlify-ddns-client = {
enable = true;
username = "beefcake.h";
# TODO: router doesn't even do ipv6 yet...
ipv6 = false;
};
}
outputs.nixosModules.deno-netlify-ddns-client family-users
{ common
services.deno-netlify-ddns-client = { podman
enable = true; troubleshooting-tools
username = "beefcake.h"; virtual-machines
# TODO: router doesn't even do ipv6 yet... virtual-machines-gui
ipv6 = false; linux
}; fonts
}
family-users ./nixos/beefcake.nix
common
podman
troubleshooting-tools
virtual-machines
virtual-machines-gui
linux
fonts
./nixos/beefcake.nix {
services.kanidm.package = (unstable.pkgsFor system).kanidm;
{ }
services.kanidm.package = (unstable.pkgsFor system).kanidm; ];
}
];
};
htpc = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-defaults
hardware.nixosModules.common-pc-ssd
common
gaming
graphical-workstation
./nixos/htpc.nix
{
home-manager.users.daniel = {
imports = with homeManagerModules; [
linux-desktop-environment-config
];
};
}
];
};
steamdeck1 = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-unstable-defaults
outputs.diskoConfigurations.unencrypted
hardware.nixosModules.common-pc-ssd
common
gaming
graphical-workstation
# plasma6
jovian.outputs.nixosModules.jovian
{
networking.hostName = "steamdeck1";
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
hardware.bluetooth.enable = true;
networking.networkmanager.enable = true;
home-manager.users.daniel = {
imports = with homeManagerModules; [
firefox-no-tabs
linux-desktop-environment-config
];
};
}
];
};
foxtrot = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-unstable-defaults
outputs.diskoConfigurations.foxtrot
hardware.nixosModules.framework-13-7040-amd
common
kde-connect
password-manager
graphical-workstation
# plasma6
# virtual-machines
# virtual-machines-gui
laptop
gaming
cross-compiler
./nixos/foxtrot.nix
({pkgs, ...}: {
home-manager.users.daniel = {
imports = with homeManagerModules; [
senpai
iex
niri
cargo
firefox-no-tabs
linux-desktop-environment-config
];
};
environment.systemPackages = with pkgs; [
fw-ectool
(writeShellApplication
{
name = "reset-wifi-module";
runtimeInputs = with pkgs; [kmod];
text = ''
modprobe -rv mt7921e
modprobe -v mt7921e
'';
})
(writeShellApplication
{
name = "perfmode";
# we use command -v $cmd here because we only want to invoke these calls _if_ the related package is installed on the system
# otherwise, they will likely have no effect anyways
text = ''
command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set balanced'
command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@120Hz'
'';
})
(writeShellApplication
{
name = "battmode";
text = ''
command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set power-saver'
command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@60Hz'
'';
})
];
})
];
};
thablet = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-unstable-defaults
{
_module.args = {
disk = "nvme0n1";
esp = {
label = "ESP";
size = "4G";
name = "ESP";
};
};
}
outputs.diskoConfigurations.standard
hardware.nixosModules.lenovo-thinkpad-x1-yoga
common
password-manager
graphical-workstation
# plasma6
music-production
laptop
touchscreen
gaming
./nixos/thablet.nix
{
home-manager.users.daniel = {
imports = with homeManagerModules; [
senpai
iex
cargo
firefox-no-tabs
linux-desktop-environment-config
# slippi.homeManagerModules.default
];
};
}
];
};
/*
grablet = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
common
outputs.diskoConfigurations.standard
hardware.nixosModules.common-cpu-intel-kaby-lake
hardware.nixosModules.common-pc-laptopp-ssd
graphical-workstation
laptop
gaming
./nixos/thablet.nix
{
home-manager.users.daniel = {
imports = with homeManagerModules; [
iex
cargo
linux-desktop-environment-config
];
};
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
}
];
};
*/
thinker = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-unstable-defaults
{
_module.args = {
disks = ["/dev/nvme0n1"];
swapSize = "32G";
};
}
outputs.diskoConfigurations.standard
hardware.nixosModules.lenovo-thinkpad-t480
hardware.nixosModules.common-pc-laptop-ssd
music-production
common
password-manager
graphical-workstation
# plasma6
laptop
gaming
./nixos/thinker.nix
{
home-manager.users.daniel = {
imports = with homeManagerModules; [
senpai
iex
cargo
firefox-no-tabs
linux-desktop-environment-config
slippi.homeManagerModules.default
];
};
}
];
};
musicbox = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-defaults
{
_module.args = {
disks = ["/dev/sda"];
# swapSize = "8G";
};
esp = {};
}
outputs.diskoConfigurations.unencrypted
hardware.nixosModules.common-pc-laptop-ssd
music-production
common
graphical-workstation
wifi
# ./nixos/musicbox.nix
{
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
hardware.bluetooth.enable = true;
networking.networkmanager.enable = true;
home-manager.users.daniel = {
imports = with homeManagerModules; [
firefox-no-tabs
linux-desktop-environment-config
];
};
}
];
};
rascal = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-defaults
hardware.nixosModules.common-cpu-amd
common
linux
./nixos/rascal.nix
];
};
router = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-defaults
common
linux
troubleshooting-tools
outputs.nixosModules.deno-netlify-ddns-client
{
services.deno-netlify-ddns-client = {
enable = true;
username = "router.h";
# TODO: ipv6
ipv6 = false;
};
}
/*
NOTE: maybe use this someday, but I think I need more concrete
networking knowledge before I know how to use it well. Additionally,
I can use my existing firewall configuration more easily if I manage
it directly.
nnf.nixosModules.default
*/
./nixos/router.nix
];
};
# pinephone-image =
# (import "${mobile-nixos}/lib/eval-with-configuration.nix" {
# configuration = with nixosModules; [
# linux
# home-manager-defaults
# # outputs.diskoConfigurations.unencrypted # can I even disko with an image-based installation?
# common
# wifi
# # TODO: how do I get a minimally useful mobile environment?
# # for me, this means an on-screen keyboard and suspend support I think?
# # I can live in a tty if needed and graphical stuff can all evolve later
# # not worried about modem
# # maybe/hopefully I can pull in or define my own sxmo via nix?
# ];
# device = "pine64-pinephone";
# pkgs = pkgsFor "aarch64-linux";
# })
# .outputs
# .disk-image;
pinephone = let
inherit (nixpkgs-unstable) lib;
in
lib.nixosSystem {
system = "aarch64-linux";
# lib.nixosSystem {
modules = with nixosModules; [
{
imports = [
(import "${mobile-nixos}/lib/configuration.nix" {
device = "pine64-pinephone";
})
];
# nixpkgs.hostPlatform.system = "aarch64-linux";
nixpkgs.buildPlatform = "x86_64-linux";
# TODO: quirk: since the pinephone kernel doesn't seem to have "rpfilter" support, firewall ain't working
networking.firewall.enable = lib.mkForce false;
# TODO: quirk: since git send-email requires perl support, which we don't seem to have on the pinephone, we're just disabling git for now
# TODO: would likely be easier/better to somehow ignore the assertion? probably a way to do that...
programs.git.enable = lib.mkForce false;
# this option is conflicted, presumably due to some assumption in my defaults/common config
# the sd-image module we're importing above has this set to true, so we better go with that?
# that said, I think the mobile-nixos bootloader module has this set to false, so...
# TODO: what does this mean?
boot.loader.generic-extlinux-compatible.enable = lib.mkForce true;
# another conflicting option since I think I default to NetworkManager and this conflicts with networking.wireless.enable
networking.networkmanager.enable = lib.mkForce false;
networking.wireless.enable = lib.mkForce true;
}
# TODO: how do I build this as a .img to flash to an SD card?
# for testing, this seems to work `nixos-rebuild build --impure --flake .#pinephone`
# TODO: would like to use the mobile-nixos installer?
"${nixpkgs-unstable}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix"
linux
home-manager-unstable-defaults
# outputs.diskoConfigurations.unencrypted # can I even disko with an image-based installation?
common
wifi
{
system.stateVersion = "24.11";
}
{
# nixpkgs.buildPlatform = "x86_64-linux";
# nixpkgs.hostPlatform = lib.systems.examples.aarch64-multiplatform;
# nixpkgs.localSystem.system = lib.systems.examples.x86_64-linux;
# nixpkgs.crossSystem = lib.mkForce null;
}
];
};
}; };
htpc = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-defaults
hardware.nixosModules.common-pc-ssd
common
gaming
graphical-workstation
./nixos/htpc.nix
{
home-manager.users.daniel = {
imports = with homeManagerModules; [
linux-desktop-environment-config
];
};
}
];
};
steamdeck1 = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-unstable-defaults
outputs.diskoConfigurations.unencrypted
hardware.nixosModules.common-pc-ssd
common
gaming
graphical-workstation
# plasma6
jovian.outputs.nixosModules.jovian
{
networking.hostName = "steamdeck1";
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
hardware.bluetooth.enable = true;
networking.networkmanager.enable = true;
home-manager.users.daniel = {
imports = with homeManagerModules; [
firefox-no-tabs
linux-desktop-environment-config
];
};
}
];
};
foxtrot = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-unstable-defaults
outputs.diskoConfigurations.foxtrot
hardware.nixosModules.framework-13-7040-amd
common
kde-connect
password-manager
graphical-workstation
# plasma6
# virtual-machines
# virtual-machines-gui
laptop
gaming
cross-compiler
./nixos/foxtrot.nix
(
{ pkgs, ... }:
{
home-manager.users.daniel = {
imports = with homeManagerModules; [
senpai
iex
niri
cargo
firefox-no-tabs
linux-desktop-environment-config
];
};
environment.systemPackages = with pkgs; [
fw-ectool
(writeShellApplication {
name = "reset-wifi-module";
runtimeInputs = with pkgs; [ kmod ];
text = ''
modprobe -rv mt7921e
modprobe -v mt7921e
'';
})
(writeShellApplication {
name = "perfmode";
# we use command -v $cmd here because we only want to invoke these calls _if_ the related package is installed on the system
# otherwise, they will likely have no effect anyways
text = ''
command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set balanced'
command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@120Hz'
'';
})
(writeShellApplication {
name = "battmode";
text = ''
command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set power-saver'
command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@60Hz'
'';
})
];
}
)
];
};
thablet = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-unstable-defaults
{
_module.args = {
disk = "nvme0n1";
esp = {
label = "ESP";
size = "4G";
name = "ESP";
};
};
}
outputs.diskoConfigurations.standard
hardware.nixosModules.lenovo-thinkpad-x1-yoga
common
password-manager
graphical-workstation
# plasma6
music-production
laptop
touchscreen
gaming
./nixos/thablet.nix
{
home-manager.users.daniel = {
imports = with homeManagerModules; [
senpai
iex
cargo
firefox-no-tabs
linux-desktop-environment-config
# slippi.homeManagerModules.default
];
};
}
];
};
/*
grablet = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
common
outputs.diskoConfigurations.standard
hardware.nixosModules.common-cpu-intel-kaby-lake
hardware.nixosModules.common-pc-laptopp-ssd
graphical-workstation
laptop
gaming
./nixos/thablet.nix
{
home-manager.users.daniel = {
imports = with homeManagerModules; [
iex
cargo
linux-desktop-environment-config
];
};
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
}
];
};
*/
thinker = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-unstable-defaults
{
_module.args = {
disks = [ "/dev/nvme0n1" ];
swapSize = "32G";
};
}
outputs.diskoConfigurations.standard
hardware.nixosModules.lenovo-thinkpad-t480
hardware.nixosModules.common-pc-laptop-ssd
music-production
common
password-manager
graphical-workstation
# plasma6
laptop
gaming
./nixos/thinker.nix
{
home-manager.users.daniel = {
imports = with homeManagerModules; [
senpai
iex
cargo
firefox-no-tabs
linux-desktop-environment-config
slippi.homeManagerModules.default
];
};
}
];
};
musicbox = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-defaults
{
_module.args = {
disks = [ "/dev/sda" ];
# swapSize = "8G";
};
esp = { };
}
outputs.diskoConfigurations.unencrypted
hardware.nixosModules.common-pc-laptop-ssd
music-production
common
graphical-workstation
wifi
# ./nixos/musicbox.nix
{
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
hardware.bluetooth.enable = true;
networking.networkmanager.enable = true;
home-manager.users.daniel = {
imports = with homeManagerModules; [
firefox-no-tabs
linux-desktop-environment-config
];
};
}
];
};
rascal = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-defaults
hardware.nixosModules.common-cpu-amd
common
linux
./nixos/rascal.nix
];
};
router = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-defaults
common
linux
troubleshooting-tools
outputs.nixosModules.deno-netlify-ddns-client
{
services.deno-netlify-ddns-client = {
enable = true;
username = "router.h";
# TODO: ipv6
ipv6 = false;
};
}
/*
NOTE: maybe use this someday, but I think I need more concrete
networking knowledge before I know how to use it well. Additionally,
I can use my existing firewall configuration more easily if I manage
it directly.
nnf.nixosModules.default
*/
./nixos/router.nix
];
};
# pinephone-image =
# (import "${mobile-nixos}/lib/eval-with-configuration.nix" {
# configuration = with nixosModules; [
# linux
# home-manager-defaults
# # outputs.diskoConfigurations.unencrypted # can I even disko with an image-based installation?
# common
# wifi
# # TODO: how do I get a minimally useful mobile environment?
# # for me, this means an on-screen keyboard and suspend support I think?
# # I can live in a tty if needed and graphical stuff can all evolve later
# # not worried about modem
# # maybe/hopefully I can pull in or define my own sxmo via nix?
# ];
# device = "pine64-pinephone";
# pkgs = pkgsFor "aarch64-linux";
# })
# .outputs
# .disk-image;
pinephone =
let
inherit (nixpkgs-unstable) lib;
in
lib.nixosSystem {
system = "aarch64-linux";
# lib.nixosSystem {
modules = with nixosModules; [
{
imports = [
(import "${mobile-nixos}/lib/configuration.nix" {
device = "pine64-pinephone";
})
];
# nixpkgs.hostPlatform.system = "aarch64-linux";
nixpkgs.buildPlatform = "x86_64-linux";
# TODO: quirk: since the pinephone kernel doesn't seem to have "rpfilter" support, firewall ain't working
networking.firewall.enable = lib.mkForce false;
# TODO: quirk: since git send-email requires perl support, which we don't seem to have on the pinephone, we're just disabling git for now
# TODO: would likely be easier/better to somehow ignore the assertion? probably a way to do that...
programs.git.enable = lib.mkForce false;
# this option is conflicted, presumably due to some assumption in my defaults/common config
# the sd-image module we're importing above has this set to true, so we better go with that?
# that said, I think the mobile-nixos bootloader module has this set to false, so...
# TODO: what does this mean?
boot.loader.generic-extlinux-compatible.enable = lib.mkForce true;
# another conflicting option since I think I default to NetworkManager and this conflicts with networking.wireless.enable
networking.networkmanager.enable = lib.mkForce false;
networking.wireless.enable = lib.mkForce true;
}
# TODO: how do I build this as a .img to flash to an SD card?
# for testing, this seems to work `nixos-rebuild build --impure --flake .#pinephone`
# TODO: would like to use the mobile-nixos installer?
"${nixpkgs-unstable}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix"
linux
home-manager-unstable-defaults
# outputs.diskoConfigurations.unencrypted # can I even disko with an image-based installation?
common
wifi
{
system.stateVersion = "24.11";
}
{
# nixpkgs.buildPlatform = "x86_64-linux";
# nixpkgs.hostPlatform = lib.systems.examples.aarch64-multiplatform;
# nixpkgs.localSystem.system = lib.systems.examples.x86_64-linux;
# nixpkgs.crossSystem = lib.mkForce null;
}
];
};
}

View file

@ -1,8 +1,9 @@
{ {
"deck" = let "deck" =
system = "x86_64-linux"; let
pkgs = unstable.pkgsFor system; system = "x86_64-linux";
in pkgs = unstable.pkgsFor system;
in
home-manager-unstable.lib.homeManagerConfiguration { home-manager-unstable.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = with homeManagerModules; [ modules = with homeManagerModules; [

View file

@ -1,6 +1,8 @@
{pkgs, ...}: let { pkgs, ... }:
iosevkaLyteTerm = pkgs.callPackage ./iosevkaLyteTerm.nix {}; let
in { iosevkaLyteTerm = pkgs.callPackage ./iosevkaLyteTerm.nix { };
in
{
inherit iosevkaLyteTerm; inherit iosevkaLyteTerm;
iosevkaLyteTermSubset = pkgs.callPackage ./iosevkaLyteTermSubset.nix { iosevkaLyteTermSubset = pkgs.callPackage ./iosevkaLyteTermSubset.nix {

View file

@ -2,7 +2,8 @@
config, config,
outputs, outputs,
... ...
}: { }:
{
# a minimal, familiar setup that I can bootstrap atop # a minimal, familiar setup that I can bootstrap atop
imports = with outputs.nixosModules; [ imports = with outputs.nixosModules; [
# may need to be tweaked based on the machine's paritioning scheme # may need to be tweaked based on the machine's paritioning scheme

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,8 @@
lib, lib,
config, config,
... ...
}: { }:
{
system.stateVersion = "24.05"; system.stateVersion = "24.05";
home-manager.users.daniel.home.stateVersion = "24.05"; home-manager.users.daniel.home.stateVersion = "24.05";
networking.hostName = "bigtower"; networking.hostName = "bigtower";
@ -14,22 +15,25 @@
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/5b6c2d65-2704-4ed1-b06d-5ee7110b3d28"; device = "/dev/disk/by-uuid/5b6c2d65-2704-4ed1-b06d-5ee7110b3d28";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=root"]; options = [ "subvol=root" ];
}; };
fileSystems."/nix" = { fileSystems."/nix" = {
device = "/dev/disk/by-uuid/5b6c2d65-2704-4ed1-b06d-5ee7110b3d28"; device = "/dev/disk/by-uuid/5b6c2d65-2704-4ed1-b06d-5ee7110b3d28";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=nix"]; options = [ "subvol=nix" ];
}; };
fileSystems."/home" = { fileSystems."/home" = {
device = "/dev/disk/by-uuid/5b6c2d65-2704-4ed1-b06d-5ee7110b3d28"; device = "/dev/disk/by-uuid/5b6c2d65-2704-4ed1-b06d-5ee7110b3d28";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=home"]; options = [ "subvol=home" ];
}; };
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/CE80-4623"; device = "/dev/disk/by-uuid/CE80-4623";
fsType = "vfat"; fsType = "vfat";
options = ["fmask=0022" "dmask=0022"]; options = [
"fmask=0022"
"dmask=0022"
];
}; };
} }
]; ];
@ -43,9 +47,14 @@
# kernelPackages = pkgs.linuxPackages_zen; # kernelPackages = pkgs.linuxPackages_zen;
loader.efi.canTouchEfiVariables = true; loader.efi.canTouchEfiVariables = true;
loader.systemd-boot.enable = true; loader.systemd-boot.enable = true;
initrd.availableKernelModules = ["xhci_pci" "nvme" "ahci" "usbhid"]; initrd.availableKernelModules = [
kernelModules = ["kvm-amd"]; "xhci_pci"
supportedFilesystems = ["ntfs"]; "nvme"
"ahci"
"usbhid"
];
kernelModules = [ "kvm-amd" ];
supportedFilesystems = [ "ntfs" ];
}; };
hardware.bluetooth = { hardware.bluetooth = {

View file

@ -8,170 +8,187 @@
nixpkgs-unstable, nixpkgs-unstable,
home-manager-unstable, home-manager-unstable,
... ...
}: let }:
baseHost = { let
nixpkgs, baseHost =
home-manager, {
... nixpkgs,
}: (path: ({system ? "x86_64-linux"}: (nixpkgs.lib.nixosSystem { home-manager,
inherit system; ...
modules = [ }:
({ (
config, path:
lib, (
pkgs, {
modulesPath, system ? "x86_64-linux",
... }:
}: { (nixpkgs.lib.nixosSystem {
imports = with self.outputs.nixosModules; [ inherit system;
(modulesPath + "/installer/scan/not-detected.nix") modules = [
home-manager.nixosModules.home-manager (
sops-nix.nixosModules.sops
disko.nixosModules.disko
deno-netlify-ddns-client
shell-defaults-and-applications
wifi
printing
podman
virtual-machines
postgres
gaming
gnome
daniel
root
];
config = {
lyte.shell.enable = lib.mkDefault true;
nixpkgs.config.allowUnfree = lib.mkDefault true;
sops = {
age = {
sshKeyPaths = lib.mkDefault ["/etc/ssh/ssh_host_ed25519_key"];
keyFile = lib.mkDefault "/var/lib/sops-nix/key.txt";
generateKey = lib.mkDefault true;
};
};
nix = {
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
registry = lib.mapAttrs (_: value: {flake = value;}) self.inputs;
settings =
{ {
trusted-users = lib.mkDefault ["@wheel"]; config,
extra-experimental-features = lib.mkDefault ["nix-command" "flakes"]; lib,
auto-optimise-store = lib.mkDefault true; pkgs,
modulesPath,
...
}:
{
imports = with self.outputs.nixosModules; [
(modulesPath + "/installer/scan/not-detected.nix")
home-manager.nixosModules.home-manager
sops-nix.nixosModules.sops
disko.nixosModules.disko
deno-netlify-ddns-client
shell-defaults-and-applications
wifi
printing
podman
virtual-machines
postgres
gaming
gnome
daniel
root
];
config = {
lyte.shell.enable = lib.mkDefault true;
nixpkgs.config.allowUnfree = lib.mkDefault true;
sops = {
age = {
sshKeyPaths = lib.mkDefault [ "/etc/ssh/ssh_host_ed25519_key" ];
keyFile = lib.mkDefault "/var/lib/sops-nix/key.txt";
generateKey = lib.mkDefault true;
};
};
nix = {
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
registry = lib.mapAttrs (_: value: { flake = value; }) self.inputs;
settings = {
trusted-users = lib.mkDefault [ "@wheel" ];
extra-experimental-features = lib.mkDefault [
"nix-command"
"flakes"
];
auto-optimise-store = lib.mkDefault true;
} // self.nixConfig;
};
systemd.services.nix-daemon.environment.TMPDIR = lib.mkDefault "/var/tmp"; # TODO: why did I do this again?
boot.tmp.cleanOnBoot = lib.mkDefault true;
programs.gnupg.agent.enable = lib.mkDefault true;
time.timeZone = lib.mkDefault "America/Chicago";
i18n.defaultLocale = lib.mkDefault "en_US.UTF-8";
hardware.enableRedistributableFirmware = lib.mkDefault true;
home-manager.useGlobalPkgs = lib.mkDefault true;
home-manager.backupFileExtension = lib.mkDefault "hm-backup";
users.users.root = {
openssh.authorizedKeys.keys = lib.mkDefault [ self.constants.pubkey ];
};
services = {
openssh = {
enable = lib.mkDefault true;
settings = {
PasswordAuthentication = lib.mkDefault false;
KbdInteractiveAuthentication = lib.mkDefault false;
PermitRootLogin = lib.mkForce "prohibit-password";
};
openFirewall = lib.mkDefault true;
/*
listenAddresses = [
{ addr = "0.0.0.0"; port = 22; }
];
*/
};
avahi = {
enable = lib.mkDefault true;
reflector = lib.mkDefault true;
openFirewall = lib.mkDefault true;
nssmdns4 = lib.mkDefault true;
};
tailscale = {
enable = lib.mkDefault true;
useRoutingFeatures = lib.mkDefault "client";
};
journald.extraConfig = lib.mkDefault "SystemMaxUse=1G";
xserver.xkb = {
layout = lib.mkDefault "us";
# have the caps-lock key instead be a ctrl key
options = lib.mkDefault "ctrl:nocaps";
};
smartd.enable = lib.mkDefault true;
fwupd.enable = lib.mkDefault true;
};
console = {
useXkbConfig = lib.mkDefault true;
earlySetup = lib.mkDefault true;
colors =
with self.constants.style.colors;
lib.mkDefault [
bg
red
green
orange
blue
purple
yellow
fg3
fgdim
red
green
orange
blue
purple
yellow
fg
];
};
networking = {
hostName = lib.mkDefault "set-a-hostname-dingus";
useDHCP = lib.mkDefault true;
firewall = {
enable = lib.mkDefault true;
allowPing = lib.mkDefault true;
};
};
};
} }
// self.nixConfig; )
};
systemd.services.nix-daemon.environment.TMPDIR = lib.mkDefault "/var/tmp"; # TODO: why did I do this again? {
boot.tmp.cleanOnBoot = lib.mkDefault true; _module.args = {
programs.gnupg.agent.enable = lib.mkDefault true; hardware = hardware.outputs.nixosModules;
time.timeZone = lib.mkDefault "America/Chicago"; diskoConfigurations = self.outputs.diskoConfigurations;
i18n.defaultLocale = lib.mkDefault "en_US.UTF-8";
hardware.enableRedistributableFirmware = lib.mkDefault true;
home-manager.useGlobalPkgs = lib.mkDefault true;
home-manager.backupFileExtension = lib.mkDefault "hm-backup";
users.users.root = {
openssh.authorizedKeys.keys = lib.mkDefault [self.constants.pubkey];
};
services = {
openssh = {
enable = lib.mkDefault true;
settings = {
PasswordAuthentication = lib.mkDefault false;
KbdInteractiveAuthentication = lib.mkDefault false;
PermitRootLogin = lib.mkForce "prohibit-password";
}; };
}
openFirewall = lib.mkDefault true; (import path)
];
/* })
listenAddresses = [ )
{ addr = "0.0.0.0"; port = 22; } );
]; stableHost = baseHost { inherit nixpkgs home-manager; };
*/
};
avahi = {
enable = lib.mkDefault true;
reflector = lib.mkDefault true;
openFirewall = lib.mkDefault true;
nssmdns4 = lib.mkDefault true;
};
tailscale = {
enable = lib.mkDefault true;
useRoutingFeatures = lib.mkDefault "client";
};
journald.extraConfig = lib.mkDefault "SystemMaxUse=1G";
xserver.xkb = {
layout = lib.mkDefault "us";
# have the caps-lock key instead be a ctrl key
options = lib.mkDefault "ctrl:nocaps";
};
smartd.enable = lib.mkDefault true;
fwupd.enable = lib.mkDefault true;
};
console = {
useXkbConfig = lib.mkDefault true;
earlySetup = lib.mkDefault true;
colors = with self.constants.style.colors;
lib.mkDefault [
bg
red
green
orange
blue
purple
yellow
fg3
fgdim
red
green
orange
blue
purple
yellow
fg
];
};
networking = {
hostName = lib.mkDefault "set-a-hostname-dingus";
useDHCP = lib.mkDefault true;
firewall = {
enable = lib.mkDefault true;
allowPing = lib.mkDefault true;
};
};
};
})
{
_module.args = {
hardware = hardware.outputs.nixosModules;
diskoConfigurations = self.outputs.diskoConfigurations;
};
}
(import path)
];
})));
stableHost = baseHost {inherit nixpkgs home-manager;};
host = baseHost { host = baseHost {
nixpkgs = nixpkgs-unstable; nixpkgs = nixpkgs-unstable;
home-manager = home-manager-unstable; home-manager = home-manager-unstable;
}; };
in { in
beefcake = stableHost ./beefcake.nix {}; {
dragon = host ./dragon.nix {}; beefcake = stableHost ./beefcake.nix { };
arm-dragon = host ./dragon.nix {system = "aarch64-linux";}; dragon = host ./dragon.nix { };
arm-dragon = host ./dragon.nix { system = "aarch64-linux"; };
} }

View file

@ -5,7 +5,8 @@
hardware, hardware,
diskoConfigurations, diskoConfigurations,
... ...
}: { }:
{
system.stateVersion = "24.11"; system.stateVersion = "24.11";
home-manager.users.daniel.home.stateVersion = "24.11"; home-manager.users.daniel.home.stateVersion = "24.11";
networking.hostName = "dragon"; networking.hostName = "dragon";
@ -14,19 +15,26 @@
kernelPackages = pkgs.linuxPackages_latest; kernelPackages = pkgs.linuxPackages_latest;
loader.efi.canTouchEfiVariables = true; loader.efi.canTouchEfiVariables = true;
loader.systemd-boot.enable = true; loader.systemd-boot.enable = true;
initrd.availableKernelModules = ["xhci_pci" "nvme" "ahci" "usbhid"]; initrd.availableKernelModules = [
kernelModules = ["kvm-amd"]; "xhci_pci"
supportedFilesystems = ["ntfs"]; "nvme"
"ahci"
"usbhid"
];
kernelModules = [ "kvm-amd" ];
supportedFilesystems = [ "ntfs" ];
}; };
imports = with hardware; [ imports = with hardware; [
(diskoConfigurations.unencrypted {disk = "/dev/nvme0n1";}) (diskoConfigurations.unencrypted { disk = "/dev/nvme0n1"; })
common-cpu-amd common-cpu-amd
common-gpu-amd common-gpu-amd
common-pc-ssd common-pc-ssd
]; ];
sops.secrets.ddns-pass = {mode = "0400";}; sops.secrets.ddns-pass = {
mode = "0400";
};
services.deno-netlify-ddns-client = { services.deno-netlify-ddns-client = {
passwordFile = config.sops.secrets.ddns-pass.path; passwordFile = config.sops.secrets.ddns-pass.path;
enable = true; enable = true;

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
imports = [ imports = [
{ {
system.stateVersion = "24.11"; system.stateVersion = "24.11";
@ -10,16 +11,16 @@
# TODO: move this to disko? # TODO: move this to disko?
# NOTE(oninstall): # NOTE(oninstall):
/* /*
sudo btrfs subvolume create /swap sudo btrfs subvolume create /swap
sudo btrfs filesystem mkswapfile --size 32g --uuid clear /swap/swapfile sudo btrfs filesystem mkswapfile --size 32g --uuid clear /swap/swapfile
sudo swapon /swap/swapfile sudo swapon /swap/swapfile
*/ */
]; ];
# findmnt -no UUID -T /swap/swapfile # findmnt -no UUID -T /swap/swapfile
# boot.resumeDevice = "/dev/disk/by-uuid/81c3354a-f629-4b6b-a249-7705aeb9f0d5"; # boot.resumeDevice = "/dev/disk/by-uuid/81c3354a-f629-4b6b-a249-7705aeb9f0d5";
# systemd.sleep.extraConfig = "HibernateDelaySec=180m"; # systemd.sleep.extraConfig = "HibernateDelaySec=180m";
services.fwupd.enable = true; services.fwupd.enable = true;
services.fwupd.extraRemotes = ["lvfs-testing"]; services.fwupd.extraRemotes = [ "lvfs-testing" ];
} }
]; ];
@ -75,19 +76,21 @@
} }
]; ];
}; };
services.hypridle = let services.hypridle =
secondsPerMinute = 60; let
lockSeconds = 10 * secondsPerMinute; secondsPerMinute = 60;
in { lockSeconds = 10 * secondsPerMinute;
settings = { in
listener = [ {
{ settings = {
timeout = lockSeconds + 55; listener = [
on-timeout = ''systemctl suspend''; {
} timeout = lockSeconds + 55;
]; on-timeout = ''systemctl suspend'';
}
];
};
}; };
};
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
settings = { settings = {
@ -117,19 +120,19 @@
}; };
/* /*
"BOE 0x0BCA Unknown" = { "BOE 0x0BCA Unknown" = {
mode = "2256x1504@60Hz"; mode = "2256x1504@60Hz";
position = "0,0"; position = "0,0";
scale = toString scale; scale = toString scale;
}; };
"Dell Inc. DELL U2720Q D3TM623" = { "Dell Inc. DELL U2720Q D3TM623" = {
# desktop left vertical monitor # desktop left vertical monitor
mode = "1920x1080@60Hz"; mode = "1920x1080@60Hz";
# transform = "90"; # transform = "90";
# scale = "1.5"; # scale = "1.5";
position = "${toString (builtins.floor (2256 / scale))},0"; position = "${toString (builtins.floor (2256 / scale))},0";
}; };
*/ */
}; };
}; };
@ -163,15 +166,15 @@
# https://github.com/void-linux/void-packages/issues/50417#issuecomment-2131802836 fix framework 13 not shutting down # https://github.com/void-linux/void-packages/issues/50417#issuecomment-2131802836 fix framework 13 not shutting down
/* /*
kernelPatches = [ kernelPatches = [
{ {
name = "framework13shutdownfix"; name = "framework13shutdownfix";
patch = builtins.fetchurl { patch = builtins.fetchurl {
url = "https://github.com/void-linux/void-packages/files/15445612/0001-Add-hopefully-a-solution-for-shutdown-regression.PATCH"; url = "https://github.com/void-linux/void-packages/files/15445612/0001-Add-hopefully-a-solution-for-shutdown-regression.PATCH";
sha256 = "sha256:10zcnzy5hkam2cnxx441b978gzhvnqlcc49k7bpz9dc28xyjik50"; sha256 = "sha256:10zcnzy5hkam2cnxx441b978gzhvnqlcc49k7bpz9dc28xyjik50";
}; };
} }
]; ];
*/ */
loader = { loader = {
@ -189,10 +192,10 @@
# NOTE(oninstall): # NOTE(oninstall):
/* /*
sudo filefrag -v /swap/swapfile | awk '$1=="0:" {print substr($4, 1, length($4)-2)}' sudo filefrag -v /swap/swapfile | awk '$1=="0:" {print substr($4, 1, length($4)-2)}'
the above won't work for btrfs, instead you need btrfs inspect-internal map-swapfile -r /swap/swapfile the above won't work for btrfs, instead you need btrfs inspect-internal map-swapfile -r /swap/swapfile
https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file
many of these come from https://wiki.archlinux.org/title/Framework_Laptop_13#Suspend many of these come from https://wiki.archlinux.org/title/Framework_Laptop_13#Suspend
*/ */
kernelParams = [ kernelParams = [
"rtc_cmos.use_acpi_alarm=1" "rtc_cmos.use_acpi_alarm=1"
@ -205,8 +208,12 @@
# NOTE(oninstall): # NOTE(oninstall):
"resume_offset=3421665" "resume_offset=3421665"
]; ];
initrd.availableKernelModules = ["xhci_pci" "nvme" "thunderbolt"]; initrd.availableKernelModules = [
kernelModules = ["kvm-amd"]; "xhci_pci"
"nvme"
"thunderbolt"
];
kernelModules = [ "kvm-amd" ];
}; };
hardware.bluetooth = { hardware.bluetooth = {
enable = true; enable = true;
@ -214,26 +221,26 @@
# simply resume the power state at the time of hibernation # simply resume the power state at the time of hibernation
powerOnBoot = false; powerOnBoot = false;
package = pkgs.bluez.overrideAttrs (finalAttrs: previousAttrs: rec { package = pkgs.bluez.overrideAttrs (
version = "5.78"; finalAttrs: previousAttrs: rec {
src = pkgs.fetchurl { version = "5.78";
url = "mirror://kernel/linux/bluetooth/bluez-${version}.tar.xz"; src = pkgs.fetchurl {
sha256 = "sha256-gw/tGRXF03W43g9eb0X83qDcxf9f+z0x227Q8A1zxeM="; url = "mirror://kernel/linux/bluetooth/bluez-${version}.tar.xz";
}; sha256 = "sha256-gw/tGRXF03W43g9eb0X83qDcxf9f+z0x227Q8A1zxeM=";
patches = []; };
buildInputs = patches = [ ];
previousAttrs.buildInputs buildInputs = previousAttrs.buildInputs ++ [
++ [
pkgs.python3Packages.pygments pkgs.python3Packages.pygments
]; ];
}); }
);
}; };
powerManagement.cpuFreqGovernor = "ondemand"; powerManagement.cpuFreqGovernor = "ondemand";
/* /*
powerManagement.resumeCommands = '' powerManagement.resumeCommands = ''
modprobe -rv mt7921e modprobe -rv mt7921e
modprobe -v mt7921e modprobe -v mt7921e
''; '';
*/ */
services.power-profiles-daemon = { services.power-profiles-daemon = {
@ -253,38 +260,42 @@
}; };
/* /*
services.tlp = { services.tlp = {
enable = true; enable = true;
settings = { settings = {
CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_SCALING_GOVERNOR_ON_BAT = "ondemand"; CPU_SCALING_GOVERNOR_ON_BAT = "ondemand";
CPU_MIN_PERF_ON_BAT = 0; CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 80; CPU_MAX_PERF_ON_BAT = 80;
CPU_SCALING_GOVERNOR_ON_AC = "performance"; CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_MIN_PERF_ON_AC = 0; CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100; CPU_MAX_PERF_ON_AC = 100;
};
}; };
};
*/ */
networking.firewall.allowedTCPPorts = let networking.firewall.allowedTCPPorts =
stardewValley = 24642; let
factorio = 34197; stardewValley = 24642;
in [ factorio = 34197;
8000 # dev stuff in
factorio [
stardewValley 8000 # dev stuff
7777 factorio
]; stardewValley
networking.firewall.allowedUDPPorts = let 7777
stardewValley = 24642; ];
factorio = 34197; networking.firewall.allowedUDPPorts =
in [ let
8000 # dev stuff stardewValley = 24642;
factorio factorio = 34197;
stardewValley in
7777 [
]; 8000 # dev stuff
factorio
stardewValley
7777
];
} }

View file

@ -3,7 +3,8 @@
config, config,
lib, lib,
... ...
}: { }:
{
networking.hostName = "htpc"; networking.hostName = "htpc";
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
@ -12,9 +13,18 @@
boot.loader.grub.device = "/dev/sda"; boot.loader.grub.device = "/dev/sda";
boot.loader.grub.useOSProber = true; boot.loader.grub.useOSProber = true;
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; boot.initrd.availableKernelModules = [
boot.initrd.kernelModules = ["8821au" "8812au"]; "xhci_pci"
boot.kernelModules = ["kvm-intel"]; "ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [
"8821au"
"8812au"
];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ boot.extraModulePackages = [
# pkgs.rtl8811au # pkgs.rtl8811au
config.boot.kernelPackages.rtl8812au config.boot.kernelPackages.rtl8812au
@ -26,7 +36,7 @@
fsType = "ext4"; fsType = "ext4";
}; };
swapDevices = []; swapDevices = [ ];
hardware.bluetooth = { hardware.bluetooth = {
enable = true; enable = true;

View file

@ -5,7 +5,8 @@
outputs, outputs,
modulesPath, modulesPath,
... ...
}: { }:
{
nixpkgs.hostPlatform = "aarch64-linux"; nixpkgs.hostPlatform = "aarch64-linux";
networking.hostName = "htpifour"; networking.hostName = "htpifour";
@ -31,11 +32,15 @@
console.enable = false; console.enable = false;
home-manager.users.daniel = { home-manager.users.daniel = {
imports = with outputs.homeManagerModules; [linux-desktop wallpaper-manager]; imports = with outputs.homeManagerModules; [
linux-desktop
wallpaper-manager
];
}; };
environment.systemPackages = with pkgs; environment.systemPackages =
#with pkgs; with pkgs;
#with pkgs;
[ [
# libcec # libcec
libraspberrypi libraspberrypi
@ -59,17 +64,17 @@
nixpkgs.overlays = [ nixpkgs.overlays = [
/* /*
nixos-22.05 nixos-22.05
(self: super: { libcec = super.libcec.override { inherit (self) libraspberrypi; }; }) (self: super: { libcec = super.libcec.override { inherit (self) libraspberrypi; }; })
nixos-22.11 nixos-22.11
(self: super: {libcec = super.libcec.override {withLibraspberrypi = true;};}) (self: super: {libcec = super.libcec.override {withLibraspberrypi = true;};})
*/ */
]; ];
# Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229 # Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
/* /*
systemd.services."getty@tty1".enable = false; systemd.services."getty@tty1".enable = false;
systemd.services."autovt@tty1".enable = false; systemd.services."autovt@tty1".enable = false;
*/ */
# hardware # hardware
@ -82,7 +87,11 @@
boot = { boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_rpi4; kernelPackages = pkgs.linuxKernel.packages.linux_rpi4;
initrd.availableKernelModules = ["xhci_pci" "usbhid" "usb_storage"]; initrd.availableKernelModules = [
"xhci_pci"
"usbhid"
"usb_storage"
];
loader = { loader = {
grub.enable = false; grub.enable = false;
generic-extlinux-compatible.enable = true; generic-extlinux-compatible.enable = true;
@ -99,43 +108,43 @@
allowedTCPPorts = [ allowedTCPPorts = [
22 # ssh 22 # ssh
]; ];
allowedUDPPorts = []; allowedUDPPorts = [ ];
}; };
}; };
/* /*
services.udev.extraRules = '' services.udev.extraRules = ''
# allow access to raspi cec device for video group (and optionally register it as a systemd device, used below) # allow access to raspi cec device for video group (and optionally register it as a systemd device, used below)
SUBSYSTEM=="vchiq", GROUP="video", MODE="0660", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/dev/vchiq" SUBSYSTEM=="vchiq", GROUP="video", MODE="0660", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/dev/vchiq"
''; '';
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
optional: attach a persisted cec-client to `/run/cec.fifo`, to avoid the CEC ~1s startup delay per command optional: attach a persisted cec-client to `/run/cec.fifo`, to avoid the CEC ~1s startup delay per command
scan for devices: `echo 'scan' &gt; /run/cec.fifo ; journalctl -u cec-client.service` scan for devices: `echo 'scan' &gt; /run/cec.fifo ; journalctl -u cec-client.service`
set pi as active source: `echo 'as' &gt; /run/cec.fifo` set pi as active source: `echo 'as' &gt; /run/cec.fifo`
systemd.sockets."cec-client" = { systemd.sockets."cec-client" = {
after = ["dev-vchiq.device"]; after = ["dev-vchiq.device"];
bindsTo = ["dev-vchiq.device"]; bindsTo = ["dev-vchiq.device"];
wantedBy = ["sockets.target"]; wantedBy = ["sockets.target"];
socketConfig = { socketConfig = {
ListenFIFO = "/run/cec.fifo"; ListenFIFO = "/run/cec.fifo";
SocketGroup = "video"; SocketGroup = "video";
SocketMode = "0660"; SocketMode = "0660";
};
}; };
}; systemd.services."cec-client" = {
systemd.services."cec-client" = { after = ["dev-vchiq.device"];
after = ["dev-vchiq.device"]; bindsTo = ["dev-vchiq.device"];
bindsTo = ["dev-vchiq.device"]; wantedBy = ["multi-user.target"];
wantedBy = ["multi-user.target"]; serviceConfig = {
serviceConfig = { ExecStart = ''${pkgs.libcec}/bin/cec-client -d 1'';
ExecStart = ''${pkgs.libcec}/bin/cec-client -d 1''; ExecStop = ''/bin/sh -c "echo q &gt; /run/cec.fifo"'';
ExecStop = ''/bin/sh -c "echo q &gt; /run/cec.fifo"''; StandardInput = "socket";
StandardInput = "socket"; StandardOutput = "journal";
StandardOutput = "journal"; Restart = "no";
Restart = "no"; };
}; };
};
*/ */
hardware.graphics.driSupport32Bit = lib.mkForce false; hardware.graphics.driSupport32Bit = lib.mkForce false;

View file

@ -2,13 +2,21 @@
config, config,
modulesPath, modulesPath,
... ...
}: { }:
{
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "ehci_pci" "usbhid" "uas" "sd_mod"]; boot.initrd.availableKernelModules = [
boot.kernelModules = ["kvm-amd"]; "xhci_pci"
"ahci"
"ehci_pci"
"usbhid"
"uas"
"sd_mod"
];
boot.kernelModules = [ "kvm-amd" ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/2e2ad73a-6264-4a7b-8439-9c05295d903d"; device = "/dev/disk/by-uuid/2e2ad73a-6264-4a7b-8439-9c05295d903d";
@ -25,26 +33,30 @@
device = "/dev/sda"; device = "/dev/sda";
}; };
users.groups.beefcake = {}; users.groups.beefcake = { };
users.users = { users.users = {
beefcake = { beefcake = {
isSystemUser = true; isSystemUser = true;
createHome = true; createHome = true;
home = "/storage/backups/beefcake"; home = "/storage/backups/beefcake";
group = "beefcake"; group = "beefcake";
extraGroups = ["sftponly"]; extraGroups = [ "sftponly" ];
openssh.authorizedKeys.keys = openssh.authorizedKeys.keys = config.users.users.daniel.openssh.authorizedKeys.keys ++ [
config.users.users.daniel.openssh.authorizedKeys.keys "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK7HrojwoyHED+A/FzRjYmIL0hzofwBd9IYHH6yV0oPO root@beefcake"
++ [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAOEI82VdbyR1RYqSnFtlffHBtHFdXO0v9RmQH7GkfXo restic@beefcake"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK7HrojwoyHED+A/FzRjYmIL0hzofwBd9IYHH6yV0oPO root@beefcake" ];
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAOEI82VdbyR1RYqSnFtlffHBtHFdXO0v9RmQH7GkfXo restic@beefcake"
];
}; };
daniel = { daniel = {
# used for restic backups # used for restic backups
isNormalUser = true; isNormalUser = true;
extraGroups = ["users" "wheel" "video" "dialout" "uucp"]; extraGroups = [
"users"
"wheel"
"video"
"dialout"
"uucp"
];
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev"
]; ];
@ -68,7 +80,7 @@
firewall = { firewall = {
enable = true; enable = true;
allowPing = true; allowPing = true;
allowedTCPPorts = [22]; allowedTCPPorts = [ 22 ];
}; };
}; };

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,8 @@
lib, lib,
config, config,
... ...
}: { }:
{
networking.hostName = "thablet"; networking.hostName = "thablet";
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
@ -17,7 +18,7 @@
environment.systemPackages = environment.systemPackages =
#with pkgs; #with pkgs;
[]; [ ];
# https://wiki.archlinux.org/title/Lenovo_ThinkPad_X1_Yoga_(Gen_3)#Using_acpi_call # https://wiki.archlinux.org/title/Lenovo_ThinkPad_X1_Yoga_(Gen_3)#Using_acpi_call
systemd.services.activate-touch-hack = { systemd.services.activate-touch-hack = {
@ -25,7 +26,12 @@
description = "Touch wake Thinkpad X1 Yoga 3rd gen hack"; description = "Touch wake Thinkpad X1 Yoga 3rd gen hack";
unitConfig = { unitConfig = {
After = ["suspend.target" "hibernate.target" "hybrid-sleep.target" "suspend-then-hibernate.target"]; After = [
"suspend.target"
"hibernate.target"
"hybrid-sleep.target"
"suspend-then-hibernate.target"
];
}; };
serviceConfig = { serviceConfig = {
@ -34,13 +40,26 @@
''; '';
}; };
wantedBy = ["suspend.target" "hibernate.target" "hybrid-sleep.target" "suspend-then-hibernate.target"]; wantedBy = [
"suspend.target"
"hibernate.target"
"hybrid-sleep.target"
"suspend-then-hibernate.target"
];
}; };
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"]; boot.initrd.availableKernelModules = [
boot.initrd.kernelModules = []; "xhci_pci"
boot.kernelModules = ["kvm-intel" "acpi_call"]; "nvme"
boot.extraModulePackages = with config.boot.kernelPackages; [acpi_call]; "usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [
"kvm-intel"
"acpi_call"
];
boot.extraModulePackages = with config.boot.kernelPackages; [ acpi_call ];
hardware = { hardware = {
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
@ -65,13 +84,21 @@
}; };
networking = { networking = {
firewall = let firewall =
terraria = 7777; let
stardew-valley = 24642; terraria = 7777;
in { stardew-valley = 24642;
allowedTCPPorts = [terraria stardew-valley]; in
allowedUDPPorts = [terraria stardew-valley]; {
}; allowedTCPPorts = [
terraria
stardew-valley
];
allowedUDPPorts = [
terraria
stardew-valley
];
};
}; };
home-manager.users.daniel = { home-manager.users.daniel = {
@ -104,19 +131,21 @@
]; ];
}; };
services.hypridle = let services.hypridle =
secondsPerMinute = 60; let
lockSeconds = 10 * secondsPerMinute; secondsPerMinute = 60;
in { lockSeconds = 10 * secondsPerMinute;
settings = { in
listener = [ {
{ settings = {
timeout = lockSeconds + 55; listener = [
on-timeout = ''systemctl suspend''; {
} timeout = lockSeconds + 55;
]; on-timeout = ''systemctl suspend'';
}
];
};
}; };
};
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
settings = { settings = {

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
networking.hostName = "thinker"; networking.hostName = "thinker";
boot = { boot = {
@ -7,13 +8,17 @@
systemd-boot.enable = true; systemd-boot.enable = true;
}; };
/* /*
sudo filefrag -v /swap/swapfile | awk '$1=="0:" {print substr($4, 1, length($4)-2)}' sudo filefrag -v /swap/swapfile | awk '$1=="0:" {print substr($4, 1, length($4)-2)}'
the above won't work for btrfs, instead you need the above won't work for btrfs, instead you need
btrfs inspect-internal map-swapfile -r /swap/swapfile btrfs inspect-internal map-swapfile -r /swap/swapfile
https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file
*/ */
# kernelParams = ["boot.shell_on_fail"]; # kernelParams = ["boot.shell_on_fail"];
initrd.availableKernelModules = ["xhci_pci" "nvme" "ahci"]; initrd.availableKernelModules = [
"xhci_pci"
"nvme"
"ahci"
];
}; };
home-manager.users.daniel = { home-manager.users.daniel = {
@ -39,19 +44,21 @@
} }
]; ];
}; };
services.hypridle = let services.hypridle =
secondsPerMinute = 60; let
lockSeconds = 10 * secondsPerMinute; secondsPerMinute = 60;
in { lockSeconds = 10 * secondsPerMinute;
settings = { in
listener = [ {
{ settings = {
timeout = lockSeconds + 55; listener = [
on-timeout = ''systemctl suspend''; {
} timeout = lockSeconds + 55;
]; on-timeout = ''systemctl suspend'';
}
];
};
}; };
};
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
settings = { settings = {

View file

@ -1,6 +1,9 @@
{iosevka, ...}: let { iosevka, ... }:
let
set = "LyteTerm"; set = "LyteTerm";
in ((iosevka.override { in
(
(iosevka.override {
inherit set; inherit set;
privateBuildPlan = '' privateBuildPlan = ''
@ -122,8 +125,8 @@ in ((iosevka.override {
question = 'smooth' question = 'smooth'
punctuation-dot = 'round' punctuation-dot = 'round'
''; '';
}) }).overrideAttrs
.overrideAttrs { {
buildPhase = '' buildPhase = ''
export HOME=$TMPDIR export HOME=$TMPDIR
runHook preBuild runHook preBuild
@ -142,4 +145,5 @@ in ((iosevka.override {
install "dist/$pname/WOFF2"/* "$wfontdir" install "dist/$pname/WOFF2"/* "$wfontdir"
runHook postInstall runHook postInstall
''; '';
}) }
)

View file

@ -9,8 +9,13 @@ pkgs.stdenvNoCC.mkDerivation {
inherit (iosevkaLyteTerm) version; inherit (iosevkaLyteTerm) version;
pname = "${iosevkaLyteTerm.pname}Subset"; pname = "${iosevkaLyteTerm.pname}Subset";
buildInputs = [parallel] ++ (with python311Packages; [fonttools brotli]); buildInputs =
PYTHONPATH = pkgs.python3.withPackages (pp: with pp; [brotli]); [ parallel ]
++ (with python311Packages; [
fonttools
brotli
]);
PYTHONPATH = pkgs.python3.withPackages (pp: with pp; [ brotli ]);
src = iosevkaLyteTerm; src = iosevkaLyteTerm;
installPhase = '' installPhase = ''