Compare commits

..

No commits in common. "main" and "beefcake-revival" have entirely different histories.

54 changed files with 3162 additions and 5644 deletions

View file

@ -1,19 +1,7 @@
keys: keys:
# list any public keys here # after updating this, you will need to `sops updatekeys secrets.file` for any files that need the new key(s)
- &daniel age1stdue5q5teskee057ced6rh9pzzr93xsy66w4sc3zu49rgxl7cjshztt45 # pass age-key | rg '# pub'
# pass age-key | rg '# pub' - &sshd-at-beefcake age1etv56f7kf78a55lxqtydrdd32dpmsjnxndf4u28qezxn6p7xt9esqvqdq7 # ssh beefcake "nix-shell -p ssh-to-age --run 'cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age'"
- &daniel age1stdue5q5teskee057ced6rh9pzzr93xsy66w4sc3zu49rgxl7cjshztt45
# per-host keys can be derived from a target host's ssh keys like so:
# ssh host "nix shell nixpkgs#ssh-to-age -c $SHELL -c 'cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age'"
- &sshd-at-beefcake age1etv56f7kf78a55lxqtydrdd32dpmsjnxndf4u28qezxn6p7xt9esqvqdq7
- &sshd-at-router age1zd7c3g5d20shdftq8ghqm0r92488dg4pdp4gulur7ex3zx2yq35ssxawpn
- &sshd-at-dragon age1ez4why08hdx0qf940cjzs6ep4q5rk2gqq7lp99pe58fktpwv65esx4xrht
- &ssh-foxtrot age1njnet9ltjuxasqv3ckn67r5natke6xgd8wlx8psf64pyc4duvurqhedw80
# after updating this file, you may need to update the keys for any associated files like so:
# sops updatekeys secrets.file
creation_rules: creation_rules:
- path_regex: secrets/[^/]+\.(ya?ml|json|env|ini)$ - path_regex: secrets/[^/]+\.(ya?ml|json|env|ini)$
key_groups: key_groups:
@ -24,18 +12,3 @@ creation_rules:
- age: - age:
- *daniel - *daniel
- *sshd-at-beefcake - *sshd-at-beefcake
- path_regex: secrets/router/[^/]+\.(ya?ml|json|env|ini)$
key_groups:
- age:
- *daniel
- *sshd-at-router
- path_regex: secrets/dragon/[^/]+\.(ya?ml|json|env|ini)$
key_groups:
- age:
- *daniel
- *sshd-at-dragon
- path_regex: secrets/foxtrot/[^/]+\.(ya?ml|json|env|ini)$
key_groups:
- age:
- *daniel
- *ssh-foxtrot

View file

@ -6,12 +6,10 @@ in {
swapSize, swapSize,
... ...
}: { }: {
/* # this is my standard partitioning scheme for my machines which probably want hibernation capabilities
this is my standard partitioning scheme for my machines which probably want hibernation capabilities # a UEFI-compatible boot partition
a UEFI-compatible boot partition # it includes an LUKS-encrypted btrfs volume
it includes an LUKS-encrypted btrfs volume # a swap partition big enough to dump all the machine's RAM into
a swap partition big enough to dump all the machine's RAM into
*/
disko.devices = { disko.devices = {
disk = { disk = {
@ -197,11 +195,9 @@ in {
beefcake = let beefcake = let
zpools = { zpools = {
zroot = { zroot = {
/* # TODO: at the time of writing, disko does not support draid6
TODO: at the time of writing, disko does not support draid6 # so I'm building/managing the array manually for the time being
so I'm building/managing the array manually for the time being # the root pool is just a single disk right now
the root pool is just a single disk right now
*/
name = "zroot"; name = "zroot";
config = { config = {
type = "zpool"; type = "zpool";
@ -246,11 +242,9 @@ in {
keylocation = "file:///tmp/secret.key"; keylocation = "file:///tmp/secret.key";
}; };
# use this to read the key during boot # use this to read the key during boot
/* # postCreateHook = ''
postCreateHook = '' # zfs set keylocation="prompt" "zroot/$name";
zfs set keylocation="prompt" "zroot/$name"; # '';
'';
*/
}; };
"encrypted/test" = { "encrypted/test" = {
type = "zfs_fs"; type = "zfs_fs";
@ -260,11 +254,9 @@ in {
}; };
}; };
zstorage = { 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
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 mountpoint=legacy zstorage/nix # sudo zfs create -o canmount=on -o mountpoint=/storage zstorage/storage
sudo zfs create -o canmount=on -o mountpoint=/storage zstorage/storage
*/
name = "zstorage"; name = "zstorage";
config = {}; config = {};
}; };

View file

@ -20,11 +20,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1731959031, "lastModified": 1724850097,
"narHash": "sha256-TGcvIjftziC1CjuiHCzrYDwmOoSFYIhdiKmLetzB5L0=", "narHash": "sha256-3BHxvFb3NJzch1X8puRMkVZujOoarQ1llu3ZcwuvsKU=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "aquamarine", "repo": "aquamarine",
"rev": "4468981c1c50999f315baa1508f0e53c4ee70c52", "rev": "23c7925dd31e79e8c06086ace3edb129a070ac01",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -34,12 +34,18 @@
} }
}, },
"crane": { "crane": {
"inputs": {
"nixpkgs": [
"helix",
"nixpkgs"
]
},
"locked": { "locked": {
"lastModified": 1727974419, "lastModified": 1709610799,
"narHash": "sha256-WD0//20h+2/yPGkO88d2nYbb23WMWYvnRyDQ9Dx4UHg=", "narHash": "sha256-5jfLQx0U9hXbi2skYMGodDJkIgffrjIOgMRjZqms2QE=",
"owner": "ipetkov", "owner": "ipetkov",
"repo": "crane", "repo": "crane",
"rev": "37e4f9f0976cb9281cd3f0c70081e5e0ecaee93f", "rev": "81c393c776d5379c030607866afef6406ca1be57",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -55,11 +61,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1732988076, "lastModified": 1724895876,
"narHash": "sha256-2uMaVAZn7fiyTUGhKgleuLYe5+EAAYB/diKxrM7g3as=", "narHash": "sha256-GSqAwa00+vRuHbq9O/yRv7Ov7W/pcMLis3HmeHv8a+Q=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "2814a5224a47ca19e858e027f7e8bff74a8ea9f1", "rev": "511388d837178979de66d14ca4a2ebd5f7991cd3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -101,32 +107,16 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1726560853, "lastModified": 1709126324,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "rev": "d465f4819400de7c8d874d50b982301f28a84605",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -140,11 +130,11 @@
"systems": "systems_3" "systems": "systems_3"
}, },
"locked": { "locked": {
"lastModified": 1726560853, "lastModified": 1710146030,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -180,11 +170,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1732021966, "lastModified": 1724857454,
"narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=", "narHash": "sha256-Qyl9Q4QMTLZnnBb/8OuQ9LSkzWjBU1T5l5zIzTxkkhk=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "3308484d1a443fc5bc92012435d79e80458fe43c", "rev": "4509ca64f1084e73bc7a721b20c669a8d4c5ebe6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -195,13 +185,13 @@
}, },
"git-hooks_2": { "git-hooks_2": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_2",
"gitignore": "gitignore_3", "gitignore": "gitignore_2",
"nixpkgs": [ "nixpkgs": [
"slippi", "slippi",
"nixpkgs" "nixpkgs"
], ],
"nixpkgs-stable": "nixpkgs-stable_3" "nixpkgs-stable": "nixpkgs-stable_2"
}, },
"locked": { "locked": {
"lastModified": 1721042469, "lastModified": 1721042469,
@ -239,28 +229,6 @@
} }
}, },
"gitignore_2": { "gitignore_2": {
"inputs": {
"nixpkgs": [
"hyprland",
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"gitignore_3": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"slippi", "slippi",
@ -284,11 +252,11 @@
}, },
"hardware": { "hardware": {
"locked": { "locked": {
"lastModified": 1733139194, "lastModified": 1724878143,
"narHash": "sha256-PVQW9ovo0CJbhuhCsrhFJGGdD1euwUornspKpBIgdok=", "narHash": "sha256-UjpKo92iZ25M05kgSOw/Ti6VZwpgdlOa73zHj8OcaDk=",
"owner": "nixos", "owner": "nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "c6c90887f84c02ce9ebf33b95ca79ef45007bf88", "rev": "95c3dfe6ef2e96ddc1ccdd7194e3cda02ca9a8ef",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -322,11 +290,11 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1733164621, "lastModified": 1724856988,
"narHash": "sha256-AhYHB343nLY4bkm9yyOT9I7LIg799ouuIBWb31gORcA=", "narHash": "sha256-JBLe2CxAhG+J8+x8qmbzkGHNYmGcSiuY2QO4Zhb72lI=",
"owner": "helix-editor", "owner": "helix-editor",
"repo": "helix", "repo": "helix",
"rev": "c0bfdd7bfe8b5a3d13e7e8631eec2e8ea0b726a5", "rev": "1b5295a3f3d7cccd96eed5bfd394807a4dae87fc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -343,16 +311,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733050161, "lastModified": 1720042825,
"narHash": "sha256-lYnT+EYE47f5yY3KS/Kd4pJ6CO9fhCqumkYYkQ3TK20=", "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "62d536255879be574ebfe9b87c4ac194febf47c5", "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-24.11", "ref": "release-24.05",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@ -364,11 +332,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733133928, "lastModified": 1724435763,
"narHash": "sha256-gU40r9AfpIr4eq+0noM8yH1Hxf+EA3dqfIpFtQl8Y1E=", "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "873e39d5f4437d2f3ab06881fea8e63e45e1d011", "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -393,11 +361,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1728669738, "lastModified": 1722623071,
"narHash": "sha256-EDNAU9AYcx8OupUzbTbWE1d3HYdeG0wO6Msg3iL1muk=", "narHash": "sha256-sLADpVgebpCBFXkA1FlCXtvEPu1tdEsTfqK1hfeHySE=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprcursor", "repo": "hyprcursor",
"rev": "0264e698149fcb857a66a53018157b41f8d97bb0", "rev": "912d56025f03d41b1ad29510c423757b4379eb1c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -410,21 +378,19 @@
"inputs": { "inputs": {
"aquamarine": "aquamarine", "aquamarine": "aquamarine",
"hyprcursor": "hyprcursor", "hyprcursor": "hyprcursor",
"hyprland-protocols": "hyprland-protocols",
"hyprlang": "hyprlang", "hyprlang": "hyprlang",
"hyprutils": "hyprutils", "hyprutils": "hyprutils",
"hyprwayland-scanner": "hyprwayland-scanner", "hyprwayland-scanner": "hyprwayland-scanner",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"pre-commit-hooks": "pre-commit-hooks",
"systems": "systems_2", "systems": "systems_2",
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1733157082, "lastModified": 1724938863,
"narHash": "sha256-rmJkUKyvaejRaQeEOpInjGjQv6rgFkm2uJ2iVlMEuOk=", "narHash": "sha256-CxVxeKpXWm5Jl5wkJFwDnmU/EhJ95/NPiTGKdjrpaLM=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "92186898c0ca1b3f72922b72c4af1723f0d9b888", "rev": "92a0dd164e9cc74060b63abae67b0204b6b6074c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -437,19 +403,21 @@
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"hyprland", "hyprland",
"xdph",
"nixpkgs" "nixpkgs"
], ],
"systems": [ "systems": [
"hyprland", "hyprland",
"xdph",
"systems" "systems"
] ]
}, },
"locked": { "locked": {
"lastModified": 1728345020, "lastModified": 1721326555,
"narHash": "sha256-xGbkc7U/Roe0/Cv3iKlzijIaFBNguasI31ynL2IlEoM=", "narHash": "sha256-zCu4R0CSHEactW9JqYki26gy8h9f6rHmSwj4XJmlHgg=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprland-protocols", "repo": "hyprland-protocols",
"rev": "a7c183800e74f337753de186522b9017a07a8cee", "rev": "5a11232266bf1a1f5952d5b179c3f4b2facaaa84",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -474,11 +442,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1728168612, "lastModified": 1724174162,
"narHash": "sha256-AnB1KfiXINmuiW7BALYrKqcjCnsLZPifhb/7BsfPbns=", "narHash": "sha256-fOOBLwil6M9QWMCiSULwjMQzrXhHXUnEqmjHX5ZHeVI=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprlang", "repo": "hyprlang",
"rev": "f054f2e44d6a0b74607a6bc0f52dba337a3db38e", "rev": "16e5c9465f04477d8a3dd48a0a26bf437986336c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -499,11 +467,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1732288281, "lastModified": 1724863980,
"narHash": "sha256-XTU9B53IjGeJiJ7LstOhuxcRjCOFkQFl01H78sT9Lg4=", "narHash": "sha256-7Ke9wFRYPUIXwm5ZndGHkWBKj6BsFTkSEXUNXQRHE54=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprutils", "repo": "hyprutils",
"rev": "b26f33cc1c8a7fd5076e19e2cce3f062dca6351c", "rev": "aadf9a27dddd2272ca354ba5a22a0c2d1f919039",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -524,11 +492,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1726874836, "lastModified": 1721324119,
"narHash": "sha256-VKR0sf0PSNCB0wPHVKSAn41mCNVCnegWmgkrneKDhHM=", "narHash": "sha256-SOOqIT27/X792+vsLSeFdrNTF+OSRp5qXv6Te+fb2Qg=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprwayland-scanner", "repo": "hyprwayland-scanner",
"rev": "500c81a9e1a76760371049a8d99e008ea77aa59e", "rev": "a048a6cb015340bd82f97c1f40a4b595ca85cc30",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -537,28 +505,6 @@
"type": "github" "type": "github"
} }
}, },
"jovian": {
"inputs": {
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"nixpkgs-unstable"
]
},
"locked": {
"lastModified": 1732739177,
"narHash": "sha256-iL32+TA/8geCzcL1r3uthrH/GPvbUak5QE++WJUkaiI=",
"owner": "Jovian-Experiments",
"repo": "Jovian-NixOS",
"rev": "8d7b2149e618696d5100c2683af1ffa893f02a75",
"type": "github"
},
"original": {
"owner": "Jovian-Experiments",
"ref": "development",
"repo": "Jovian-NixOS",
"type": "github"
}
},
"libpng": { "libpng": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -576,51 +522,13 @@
"type": "github" "type": "github"
} }
}, },
"mobile-nixos": {
"flake": false,
"locked": {
"lastModified": 1728423157,
"narHash": "sha256-pJaC+Aef6oixhV6HdWPS2Pq/TgHxEN+MPLYUjighWYI=",
"owner": "lytedev",
"repo": "mobile-nixos",
"rev": "b2c496bbcebc85a28d1d939b56bd331536bd1ac4",
"type": "github"
},
"original": {
"owner": "lytedev",
"repo": "mobile-nixos",
"type": "github"
}
},
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"jovian",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729697500,
"narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=",
"owner": "zhaofengli",
"repo": "nix-github-actions",
"rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"ref": "matrix-name",
"repo": "nix-github-actions",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1728018373, "lastModified": 1709479366,
"narHash": "sha256-NOiTvBbRLIOe5F6RbHaAh6++BNjsb149fGZd1T4+KBg=", "narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "bc947f541ae55e999ffdb4013441347d83b00feb", "rev": "b8697e57f10292a6165a20f03d2f42920dfaf973",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -632,11 +540,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1730741070, "lastModified": 1720386169,
"narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=", "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d063c1dd113c91ab27959ba540c0d9753409edf3", "rev": "194846768975b7ad2c4988bdb82572c00222c0d7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -647,22 +555,6 @@
} }
}, },
"nixpkgs-stable_2": { "nixpkgs-stable_2": {
"locked": {
"lastModified": 1730741070,
"narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d063c1dd113c91ab27959ba540c0d9753409edf3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_3": {
"locked": { "locked": {
"lastModified": 1720386169, "lastModified": 1720386169,
"narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=",
@ -680,11 +572,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1733064805, "lastModified": 1724999960,
"narHash": "sha256-7NbtSLfZO0q7MXPl5hzA0sbVJt6pWxxtGWbaVUDDmjs=", "narHash": "sha256-LB3jqSGW5u1ZcUcX6vO/qBOq5oXHlmOCxsTXGMEitp4=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "31d66ae40417bb13765b0ad75dd200400e98de84", "rev": "b96f849e725333eb2b1c7f1cb84ff102062468ba",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -696,11 +588,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1732758367, "lastModified": 1724819573,
"narHash": "sha256-RzaI1RO0UXqLjydtz3GAXSTzHkpb/lLD1JD8a0W4Wpo=", "narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "fa42b5a5f401aab8a32bd33c9a4de0738180dc59", "rev": "71e91c409d1e654808b2621f28a327acfdad8dc2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -712,44 +604,20 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1732981179, "lastModified": 1724727824,
"narHash": "sha256-F7thesZPvAMSwjRu0K8uFshTk3ZZSNAsXTIFvXBT+34=", "narHash": "sha256-0XH9MJk54imJm+RHOLTUJ7e+ponLW00tw5ke4MTVa1Y=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "62c435d93bf046a5396f3016472e8f7c8e2aed65", "rev": "36bae45077667aff5720e5b3f1a5458f51cf0776",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-24.11", "ref": "nixos-24.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
"gitignore": "gitignore_2",
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1732021966,
"narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "3308484d1a443fc5bc92012435d79e80458fe43c",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"disko": "disko", "disko": "disko",
@ -759,8 +627,6 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"home-manager-unstable": "home-manager-unstable", "home-manager-unstable": "home-manager-unstable",
"hyprland": "hyprland", "hyprland": "hyprland",
"jovian": "jovian",
"mobile-nixos": "mobile-nixos",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_3",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"slippi": "slippi", "slippi": "slippi",
@ -770,17 +636,21 @@
}, },
"rust-overlay": { "rust-overlay": {
"inputs": { "inputs": {
"flake-utils": [
"helix",
"flake-utils"
],
"nixpkgs": [ "nixpkgs": [
"helix", "helix",
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1728268235, "lastModified": 1709604635,
"narHash": "sha256-lJMFnMO4maJuNO6PQ5fZesrTmglze3UFTTBuKGwR1Nw=", "narHash": "sha256-le4fwmWmjGRYWwkho0Gr7mnnZndOOe4XGbLw68OvF40=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "25685cc2c7054efc31351c172ae77b21814f2d42", "rev": "e86c0fb5d3a22a5f30d7f64ecad88643fe26449d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -797,11 +667,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1729477859, "lastModified": 1721441897,
"narHash": "sha256-r0VyeJxy4O4CgTB/PNtfQft9fPfN1VuGvnZiCxDArvg=", "narHash": "sha256-gYGX9/22tPNeF7dR6bWN5rsrpU4d06GnQNNgZ6ZiXz0=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "ada8266712449c4c0e6ee6fcbc442b3c217c79e1", "rev": "b7996075da11a2d441cfbf4e77c2939ce51506fd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -821,11 +691,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1725994332, "lastModified": 1722375582,
"narHash": "sha256-gla6TlSG6MIczpJ7xhXA66amcaJPAZ9lFHSUrLmR/QY=", "narHash": "sha256-NKUQoYIr+982vUXwlDGbBFY4259CX/mngVHYH4sjL8Y=",
"owner": "lytedev", "owner": "lytedev",
"repo": "slippi-nix", "repo": "slippi-nix",
"rev": "68e971a57de45fb3f2081e837962f2c9b8c34240", "rev": "ec418c0b7ed1191e227b2d821c02ee5b5fbe68f1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -838,14 +708,17 @@
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs-unstable" "nixpkgs-unstable"
],
"nixpkgs-stable": [
"nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1733128155, "lastModified": 1723501126,
"narHash": "sha256-m6/qwJAJYcidGMEdLqjKzRIjapK4nUfMq7rDCTmZajc=", "narHash": "sha256-N9IcHgj/p1+2Pvk8P4Zc1bfrMwld5PcosVA0nL6IGdE=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "c6134b6fff6bda95a1ac872a2a9d5f32e3c37856", "rev": "be0eec2d27563590194a9206f551a6f73d52fa34",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -913,11 +786,11 @@
}, },
"locked": { "locked": {
"dir": "nix", "dir": "nix",
"lastModified": 1732918908, "lastModified": 1723525023,
"narHash": "sha256-k43oaC+35/LGqJ+3MjIhn4Ko+ap3wTvHCJ4sj9W/o+k=", "narHash": "sha256-ZsDJQSUokodwFMP4FIZm2dYojf5iC4F/EeKC5VuQlqY=",
"owner": "wez", "owner": "wez",
"repo": "wezterm", "repo": "wezterm",
"rev": "4906789a6d61da58f73b95f89b59c41af60e0f3b", "rev": "30345b36d8a00fed347e4df5dadd83915a7693fb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -929,22 +802,11 @@
}, },
"xdph": { "xdph": {
"inputs": { "inputs": {
"hyprland-protocols": [ "hyprland-protocols": "hyprland-protocols",
"hyprland",
"hyprland-protocols"
],
"hyprlang": [ "hyprlang": [
"hyprland", "hyprland",
"hyprlang" "hyprlang"
], ],
"hyprutils": [
"hyprland",
"hyprutils"
],
"hyprwayland-scanner": [
"hyprland",
"hyprwayland-scanner"
],
"nixpkgs": [ "nixpkgs": [
"hyprland", "hyprland",
"nixpkgs" "nixpkgs"
@ -955,11 +817,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1731703417, "lastModified": 1724073926,
"narHash": "sha256-rheDc/7C+yI+QspYr9J2z9kQ5P9F4ATapI7qyFAe1XA=", "narHash": "sha256-nWlUL43jOFHf+KW6Hqrx+W/r1XdXuDyb0wC/SrHsOu4=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland", "repo": "xdg-desktop-portal-hyprland",
"rev": "8070f36deec723de71e7557441acb17e478204d3", "rev": "a08ecbbf33598924e93542f737fc6169a26b481e",
"type": "github" "type": "github"
}, },
"original": { "original": {

332
flake.nix
View file

@ -1,6 +1,6 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
disko.url = "github:nix-community/disko/master"; disko.url = "github:nix-community/disko/master";
@ -8,12 +8,12 @@
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs-unstable"; sops-nix.inputs.nixpkgs.follows = "nixpkgs-unstable";
# sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs"; sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs";
git-hooks.url = "github:cachix/git-hooks.nix"; git-hooks.url = "github:cachix/git-hooks.nix";
git-hooks.inputs.nixpkgs.follows = "nixpkgs"; git-hooks.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager/release-24.11"; home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager-unstable.url = "github:nix-community/home-manager"; home-manager-unstable.url = "github:nix-community/home-manager";
@ -31,15 +31,7 @@
slippi.inputs.nixpkgs.follows = "nixpkgs-unstable"; slippi.inputs.nixpkgs.follows = "nixpkgs-unstable";
slippi.inputs.home-manager.follows = "home-manager-unstable"; slippi.inputs.home-manager.follows = "home-manager-unstable";
jovian.url = "github:Jovian-Experiments/Jovian-NixOS/development";
jovian.inputs.nixpkgs.follows = "nixpkgs-unstable";
# nnf.url = "github:thelegy/nixos-nftables-firewall?rev=71fc2b79358d0dbacde83c806a0f008ece567b7b"; # nnf.url = "github:thelegy/nixos-nftables-firewall?rev=71fc2b79358d0dbacde83c806a0f008ece567b7b";
mobile-nixos = {
url = "github:lytedev/mobile-nixos";
flake = false;
};
}; };
nixConfig = { nixConfig = {
@ -49,7 +41,7 @@
"https://cache.nixos.org/" "https://cache.nixos.org/"
"https://helix.cachix.org" "https://helix.cachix.org"
"https://nix-community.cachix.org" "https://nix-community.cachix.org"
"https://nix.h.lyte.dev" # "https://nix.h.lyte.dev"
"https://hyprland.cachix.org" "https://hyprland.cachix.org"
]; ];
@ -74,8 +66,6 @@
home-manager-unstable, home-manager-unstable,
helix, helix,
hardware, hardware,
jovian,
mobile-nixos,
# nnf, # nnf,
# hyprland, # hyprland,
slippi, slippi,
@ -89,7 +79,7 @@
forSystems = nixpkgs.lib.genAttrs systems; forSystems = nixpkgs.lib.genAttrs systems;
pkgsFor = system: (import nixpkgs {inherit system;}).extend overlays.default; pkgsFor = system: (import nixpkgs {inherit system;}).extend overlays.default;
genPkgs = func: (forSystems (system: func (pkgsFor system))); genPkgs = func: (forSystems (system: func (pkgsFor system)));
# pkg = callee: overrides: genPkgs (pkgs: pkgs.callPackage callee overrides); pkg = callee: overrides: genPkgs (pkgs: pkgs.callPackage callee overrides);
unstable = { unstable = {
forSystems = nixpkgs-unstable.lib.genAttrs systems; forSystems = nixpkgs-unstable.lib.genAttrs systems;
@ -98,30 +88,24 @@
pkg = callee: overrides: genPkgs (pkgs: pkgs.callPackage callee overrides); pkg = callee: overrides: genPkgs (pkgs: pkgs.callPackage callee overrides);
}; };
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";
size = 12; # size = 12;
}; # };
};
/* # moduleArgs = {
moduleArgs = { # # inherit colors font;
# 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";
in { in {
/* # kind of a quirk, but package definitions are actually in the "additions"
kind of a quirk, but package definitions are actually in the "additions" # overlay I did this to work around some recursion problems
overlay I did this to work around some recursion problems # TODO: https://discourse.nixos.org/t/infinite-recursion-getting-started-with-overlays/48880
TODO: https://discourse.nixos.org/t/infinite-recursion-getting-started-with-overlays/48880
*/
packages = genPkgs (pkgs: {inherit (pkgs) iosevkaLyteTerm iosevkaLyteTermSubset nix-base-container-image;}); packages = genPkgs (pkgs: {inherit (pkgs) iosevkaLyteTerm iosevkaLyteTermSubset nix-base-container-image;});
diskoConfigurations = import ./disko {inherit (nixpkgs) lib;}; diskoConfigurations = import ./disko {inherit (nixpkgs) lib;};
templates = import ./templates; templates = import ./templates;
@ -183,7 +167,7 @@
nodejs nodejs
wget wget
sudo sudo
nixVersions.stable nixFlakes
cacert cacert
gnutar gnutar
gzip gzip
@ -235,31 +219,12 @@
in rec { in rec {
helix = helix.outputs.packages.${prev.system}.helix; helix = helix.outputs.packages.${prev.system}.helix;
final.helix = helix; final.helix = helix;
/* # TODO: would love to use a current wezterm build so I can make use of ssh/mux functionality without breakage
TODO: would love to use a current wezterm build so I can make use of ssh/mux functionality without breakage # source: https://github.com/wez/wezterm/issues/3771
source: https://github.com/wez/wezterm/issues/3771 # not-yet-merged (abandoned?): https://github.com/wez/wezterm/pull/4737
not-yet-merged (abandoned?): https://github.com/wez/wezterm/pull/4737 # I did try using the latest code via the flake, but alas it did not resolve my issues with mux'ing
I did try using the latest code via the flake, but alas it did not resolve my issues with mux'ing
*/
wezterm = wezterm-input.outputs.packages.${prev.system}.default; wezterm = wezterm-input.outputs.packages.${prev.system}.default;
# wezterm = (import nixpkgs {inherit (prev) system;}).wezterm;
final.wezterm = wezterm; final.wezterm = wezterm;
# zellij = prev.zellij.overrideAttrs rec {
# version = "0.41.0";
# src = prev.fetchFromGitHub {
# owner = "zellij-org";
# repo = "zellij";
# rev = "v0.41.0";
# hash = "sha256-A+JVWYz0t9cVA8XZciOwDkCecsC2r5TU2O9i9rVg7do=";
# };
# cargoDeps = prev.zellij.cargoDeps.overrideAttrs (prev.lib.const {
# name = "zellij-vendor.tar.gz";
# inherit src;
# outputHash = "sha256-WxrMI7fV0pNsGjbNpXLr+xnMdWYkC4WxIeN4OK3ZPIE=";
# });
# };
# final.zellij = zellij;
}; };
unstable-packages = final: _prev: { unstable-packages = final: _prev: {
@ -271,22 +236,19 @@
}; };
nixosModules = import ./modules/nixos { nixosModules = import ./modules/nixos {
inherit home-manager home-manager-unstable helix nixosModules homeManagerModules pubkey overlays style sops-nix disko; inherit home-manager home-manager-unstable helix nixosModules homeManagerModules pubkey overlays colors sops-nix disko;
flakeInputs = self.inputs; flakeInputs = self.inputs;
}; };
homeManagerModules = import ./modules/home-manager { homeManagerModules = import ./modules/home-manager {
inherit home-manager home-manager-unstable helix nixosModules homeManagerModules pubkey overlays style; inherit home-manager home-manager-unstable helix nixosModules homeManagerModules pubkey overlays colors;
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
flakeInputs = self.inputs; flakeInputs = self.inputs;
}; };
nixosConfigurations = { nixosConfigurations = {
beefcake = let beefcake = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
in
nixpkgs.lib.nixosSystem {
inherit system;
modules = with nixosModules; [ modules = with nixosModules; [
home-manager-defaults home-manager-defaults
@ -294,6 +256,7 @@
hardware.nixosModules.common-cpu-intel hardware.nixosModules.common-cpu-intel
outputs.nixosModules.deno-netlify-ddns-client outputs.nixosModules.deno-netlify-ddns-client
{ {
services.deno-netlify-ddns-client = { services.deno-netlify-ddns-client = {
enable = true; enable = true;
@ -303,20 +266,13 @@
}; };
} }
family-users
common common
podman podman
troubleshooting-tools troubleshooting-tools
virtual-machines
virtual-machines-gui
linux linux
fonts fonts
./nixos/beefcake.nix ./nixos/beefcake.nix
{
services.kanidm.package = (unstable.pkgsFor system).kanidm;
}
]; ];
}; };
@ -333,23 +289,10 @@
password-manager password-manager
wifi wifi
graphical-workstation graphical-workstation
virtual-machines
virtual-machines-gui
music-production music-production
# plasma6
gaming gaming
slippi.nixosModules.default slippi.nixosModules.default
outputs.nixosModules.deno-netlify-ddns-client
{
services.deno-netlify-ddns-client = {
enable = true;
username = "dragon.h";
# TODO: router doesn't even do ipv6 yet...
ipv6 = false;
};
}
./nixos/dragon.nix ./nixos/dragon.nix
{ {
@ -401,10 +344,10 @@
home-manager-defaults home-manager-defaults
hardware.nixosModules.common-pc-ssd hardware.nixosModules.common-pc-ssd
common common
gaming gaming
graphical-workstation graphical-workstation
plasma6
./nixos/htpc.nix ./nixos/htpc.nix
@ -418,37 +361,6 @@
]; ];
}; };
steamdeck1 = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-unstable-defaults
outputs.diskoConfigurations.standard
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 { foxtrot = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = with nixosModules; [ modules = with nixosModules; [
@ -458,15 +370,10 @@
hardware.nixosModules.framework-13-7040-amd hardware.nixosModules.framework-13-7040-amd
common common
kde-connect
password-manager password-manager
graphical-workstation graphical-workstation
# plasma6
virtual-machines
virtual-machines-gui
laptop laptop
gaming gaming
cross-compiler
./nixos/foxtrot.nix ./nixos/foxtrot.nix
@ -491,24 +398,6 @@
modprobe -v 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'
'';
})
]; ];
}) })
]; ];
@ -524,7 +413,6 @@
common common
password-manager password-manager
graphical-workstation graphical-workstation
plasma6
music-production music-production
laptop laptop
gaming gaming
@ -546,35 +434,33 @@
]; ];
}; };
/* # grablet = nixpkgs.lib.nixosSystem {
grablet = nixpkgs.lib.nixosSystem { # system = "x86_64-linux";
system = "x86_64-linux"; # modules = with nixosModules; [
modules = with nixosModules; [ # common
common
outputs.diskoConfigurations.standard # outputs.diskoConfigurations.standard
hardware.nixosModules.common-cpu-intel-kaby-lake # hardware.nixosModules.common-cpu-intel-kaby-lake
hardware.nixosModules.common-pc-laptopp-ssd # hardware.nixosModules.common-pc-laptopp-ssd
graphical-workstation # graphical-workstation
laptop # laptop
gaming # gaming
./nixos/thablet.nix # ./nixos/thablet.nix
{ # {
home-manager.users.daniel = { # home-manager.users.daniel = {
imports = with homeManagerModules; [ # imports = with homeManagerModules; [
iex # iex
cargo # cargo
linux-desktop-environment-config # linux-desktop-environment-config
]; # ];
}; # };
powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; # powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
} # }
]; # ];
}; # };
*/
thinker = nixpkgs-unstable.lib.nixosSystem { thinker = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
@ -595,7 +481,6 @@
common common
password-manager password-manager
graphical-workstation graphical-workstation
plasma6
laptop laptop
gaming gaming
@ -673,115 +558,16 @@
linux linux
troubleshooting-tools troubleshooting-tools
outputs.nixosModules.deno-netlify-ddns-client # NOTE: maybe use this someday, but I think I need more concrete
{ # networking knowledge before I know how to use it well. Additionally,
services.deno-netlify-ddns-client = { # I can use my existing firewall configuration more easily if I manage
enable = true; # it directly.
username = "router.h"; # nnf.nixosModules.default
# 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 ./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;
}
];
}; };
};
images.pinephone = outputs.nixosConfigurations.pinephone.config.system.build.sdImage;
homeConfigurations = { homeConfigurations = {
"deck" = let "deck" = let
@ -810,10 +596,8 @@
}; };
}; };
/* # TODO: nix-on-droid for phone terminal usage?
TODO: nix-on-droid for phone terminal usage? mobile-nixos? # TODO: nix-darwin for work?
TODO: nix-darwin for work? # TODO: nixos ISO?
TODO: nixos ISO?
*/
}; };
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

View file

@ -1,380 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="141.5919mm"
height="122.80626mm"
viewBox="0 0 501.70361 435.14028"
id="svg2"
version="1.1"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)"
sodipodi:docname="Nix_snowflake_lytedev.svg"
inkscape:export-filename="Nix_snowflake_lytedev.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs4">
<linearGradient
inkscape:collect="always"
id="linearGradient5562">
<stop
style="stop-color:#699ad7;stop-opacity:1"
offset="0"
id="stop5564" />
<stop
id="stop5566"
offset="0.24345198"
style="stop-color:#7eb1dd;stop-opacity:1" />
<stop
style="stop-color:#7ebae4;stop-opacity:1"
offset="1"
id="stop5568" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient5053">
<stop
style="stop-color:#415e9a;stop-opacity:1"
offset="0"
id="stop5055" />
<stop
id="stop5057"
offset="0.23168644"
style="stop-color:#4a6baf;stop-opacity:1" />
<stop
style="stop-color:#5277c3;stop-opacity:1"
offset="1"
id="stop5059" />
</linearGradient>
<linearGradient
id="linearGradient5960"
inkscape:collect="always">
<stop
id="stop5962"
offset="0"
style="stop-color:#637ddf;stop-opacity:1" />
<stop
style="stop-color:#649afa;stop-opacity:1"
offset="0.23168644"
id="stop5964" />
<stop
id="stop5966"
offset="1"
style="stop-color:#719efa;stop-opacity:1" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient5867">
<stop
style="stop-color:#7363df;stop-opacity:1"
offset="0"
id="stop5869" />
<stop
id="stop5871"
offset="0.23168644"
style="stop-color:#6478fa;stop-opacity:1" />
<stop
style="stop-color:#719efa;stop-opacity:1"
offset="1"
id="stop5873" />
</linearGradient>
<linearGradient
y2="515.97058"
x2="282.26105"
y1="338.62445"
x1="213.95642"
gradientTransform="translate(983.36076,601.38885)"
gradientUnits="userSpaceOnUse"
id="linearGradient5855"
xlink:href="#linearGradient5960"
inkscape:collect="always" />
<linearGradient
y2="515.97058"
x2="282.26105"
y1="338.62445"
x1="213.95642"
gradientTransform="translate(-197.75174,-337.1451)"
gradientUnits="userSpaceOnUse"
id="linearGradient5855-8"
xlink:href="#linearGradient5867"
inkscape:collect="always" />
<linearGradient
y2="247.58188"
x2="-702.75317"
y1="102.74675"
x1="-775.20807"
gradientTransform="translate(983.36076,601.38885)"
gradientUnits="userSpaceOnUse"
id="linearGradient4544"
xlink:href="#linearGradient5960"
inkscape:collect="always" />
<clipPath
id="clipPath4501"
clipPathUnits="userSpaceOnUse">
<circle
r="241.06563"
cy="686.09473"
cx="335.13995"
id="circle4503"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#adadad;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
</clipPath>
<clipPath
id="clipPath5410"
clipPathUnits="userSpaceOnUse">
<circle
r="241.13741"
cy="340.98975"
cx="335.98114"
id="circle5412"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
</clipPath>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5053"
id="linearGradient5137"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(864.55062,-2197.497)"
x1="-584.19934"
y1="782.33563"
x2="-496.29703"
y2="937.71399" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5053"
id="linearGradient5147"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(864.55062,-2197.497)"
x1="-584.19934"
y1="782.33563"
x2="-496.29703"
y2="937.71399" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5562"
id="linearGradient5162"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(70.505061,-1761.3076)"
x1="200.59668"
y1="351.41116"
x2="290.08701"
y2="506.18814" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5562"
id="linearGradient5172"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(70.505061,-1761.3076)"
x1="200.59668"
y1="351.41116"
x2="290.08701"
y2="506.18814" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5562"
id="linearGradient5182"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(70.505061,-1761.3076)"
x1="200.59668"
y1="351.41116"
x2="290.08701"
y2="506.18814" />
<linearGradient
y2="506.18814"
x2="290.08701"
y1="351.41116"
x1="200.59668"
gradientTransform="translate(70.505061,-1761.3076)"
gradientUnits="userSpaceOnUse"
id="linearGradient5201"
xlink:href="#linearGradient5562"
inkscape:collect="always" />
<linearGradient
y2="937.71399"
x2="-496.29703"
y1="782.33563"
x1="-584.19934"
gradientTransform="translate(864.55062,-2197.497)"
gradientUnits="userSpaceOnUse"
id="linearGradient5205"
xlink:href="#linearGradient5053"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98318225"
inkscape:cx="112.8987"
inkscape:cy="191.21582"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="2059"
inkscape:window-height="1588"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:snap-global="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:showpageshadow="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#505050" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="print-logo"
inkscape:groupmode="layer"
id="layer1"
style="display:inline"
transform="translate(-156.33871,933.1905)">
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5277c3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 309.40365,-710.2521 122.19683,211.6751 -56.15706,0.5268 -32.6236,-56.8692 -32.85645,56.5653 -27.90237,-0.011 -14.29086,-24.6896 46.81047,-80.4902 -33.22946,-57.8256 z"
id="path4861"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccc" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#df3c59;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 353.50926,-797.4433 -122.21756,211.6631 -28.53477,-48.37 32.93839,-56.6875 -65.41521,-0.1719 -13.9414,-24.1698 14.23637,-24.721 93.11177,0.2939 33.46371,-57.6903 z"
id="use4863"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccc" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#df3c59;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 362.88537,-628.243 244.41439,0.012 -27.62229,48.8968 -65.56199,-0.1817 32.55876,56.7371 -13.96098,24.1585 -28.52722,0.032 -46.3013,-80.7841 -66.69317,-0.1353 z"
id="use4865"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccc" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#df3c59;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 505.14318,-720.9886 -122.19683,-211.6751 56.15706,-0.5268 32.6236,56.8692 32.85645,-56.5653 27.90237,0.011 14.29086,24.6896 -46.81047,80.4902 33.22946,57.8256 z"
id="use4867"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccc" />
<path
sodipodi:nodetypes="cccccccccc"
inkscape:connector-curvature="0"
id="path4873"
d="m 309.40365,-710.2521 122.19683,211.6751 -56.15706,0.5268 -32.6236,-56.8692 -32.85645,56.5653 -27.90237,-0.011 -14.29086,-24.6896 46.81047,-80.4902 -33.22946,-57.8256 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#8e293b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
sodipodi:nodetypes="cccccccccc"
inkscape:connector-curvature="0"
id="use4875"
d="m 451.3364,-803.53264 -244.4144,-0.012 27.62229,-48.89685 65.56199,0.18175 -32.55875,-56.73717 13.96097,-24.15851 28.52722,-0.0315 46.3013,80.78414 66.69317,0.13524 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#8e293b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
sodipodi:nodetypes="cccccccccc"
inkscape:connector-curvature="0"
id="use4877"
d="m 460.87178,-633.8425 122.21757,-211.66304 28.53477,48.37003 -32.93839,56.68751 65.4152,0.1718 13.9414,24.1698 -14.23636,24.7211 -93.11177,-0.294 -33.46371,57.6904 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#8e293b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<g
id="layer2"
inkscape:label="guides"
style="display:none"
transform="translate(72.039038,-1799.4476)">
<path
d="M 460.60629,594.72881 209.74183,594.7288 84.309616,377.4738 209.74185,160.21882 l 250.86446,1e-5 125.43222,217.255 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="true"
sodipodi:arg2="1.5707963"
sodipodi:arg1="1.0471976"
sodipodi:r2="217.25499"
sodipodi:r1="250.86446"
sodipodi:cy="377.47382"
sodipodi:cx="335.17407"
sodipodi:sides="6"
id="path6032"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.236;fill:#4e4d52;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
sodipodi:type="star" />
<path
transform="translate(0,-308.26772)"
sodipodi:type="star"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#4e4d52;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
id="path5875"
sodipodi:sides="6"
sodipodi:cx="335.17407"
sodipodi:cy="685.74158"
sodipodi:r1="100.83495"
sodipodi:r2="87.32563"
sodipodi:arg1="1.0471976"
sodipodi:arg2="1.5707963"
inkscape:flatsided="true"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 385.59154,773.06721 -100.83495,0 -50.41747,-87.32564 50.41748,-87.32563 100.83495,10e-6 50.41748,87.32563 z" />
<path
transform="translate(0,-308.26772)"
sodipodi:nodetypes="ccccccccc"
inkscape:connector-curvature="0"
id="path5851"
d="m 1216.5591,938.53395 123.0545,228.14035 -42.6807,-1.2616 -43.4823,-79.7725 -39.6506,80.3267 -32.6875,-19.7984 53.4737,-100.2848 -37.1157,-73.88955 z"
style="fill:url(#linearGradient5855);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.415;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#c53a3a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect5884"
width="48.834862"
height="226.22897"
x="-34.74221"
y="446.17056"
transform="rotate(-30)" />
<path
transform="translate(0,-308.26772)"
sodipodi:type="star"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.509;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="path3428"
sodipodi:sides="6"
sodipodi:cx="223.93674"
sodipodi:cy="878.63831"
sodipodi:r1="28.048939"
sodipodi:r2="24.291094"
sodipodi:arg1="0"
sodipodi:arg2="0.52359878"
inkscape:flatsided="true"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 251.98568,878.63831 -14.02447,24.29109 h -28.04894 l -14.02447,-24.29109 14.02447,-24.2911 h 28.04894 z" />
<use
x="0"
y="0"
xlink:href="#rect5884"
id="use4252"
transform="rotate(60,268.29786,489.4515)"
width="100%"
height="100%" />
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:0.650794;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4254"
width="5.3947482"
height="115.12564"
x="545.71014"
y="467.07007"
transform="rotate(30,575.23539,-154.13386)" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 19 KiB

File diff suppressed because it is too large Load diff

View file

@ -38,7 +38,7 @@ $rosewater: #f5e0dc;
font-size: 12.0pt; font-size: 12.0pt;
} }
.leftsidestuff slider { .sidestuff slider {
color: $sapphire; color: $sapphire;
} }
@ -84,7 +84,6 @@ $rosewater: #f5e0dc;
} }
.workspace { .workspace {
/* height: 100%; */
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
color: #666666; color: #666666;

View file

@ -1,9 +1,8 @@
(defwidget bar [] (defwidget bar []
(centerbox :orientation "h" (centerbox :orientation "h"
(leftsidestuff) (sidestuff)
(box) (box)
(rightsidestuff) (music)))
))
(defwindow bar0 (defwindow bar0
:monitor 0 :monitor 0
@ -31,16 +30,14 @@
:anchor "bottom center") :anchor "bottom center")
(bar)) (bar))
(defwidget rightsidestuff [] (defwidget sidestuff []
(box :class "rightsidestuff" :orientation "h" :space-evenly false :halign "end" :valign "center" :spacing 10 (box :class "sidestuff" :orientation "h" :space-evenly false :halign "start" :valign "center" :spacing 10
(music)
(systray)
))
(defwidget leftsidestuff []
(box :class "leftsidestuff" :orientation "h" :space-evenly false :halign "start" :valign "center" :spacing 10
time time
; TODO: indicator/tray/taskbar/toolbar icons and management? (probably should use something standalone?)
; https://github.com/elkowar/eww/issues/111
; TODO: idle inhibitor? ; TODO: idle inhibitor?
; TODO: hyprland workspaces?
; TODO: get these to align properly? icons seem lower than they should be? ; TODO: get these to align properly? icons seem lower than they should be?
(box :class "mic" ( (box :class "mic" (
box :class {micMuted == "false" ? "live" : "muted"} {micMuted == "false" ? " " : " "} box :class {micMuted == "false" ? "live" : "muted"} {micMuted == "false" ? " " : " "}
@ -51,7 +48,7 @@
) {"${volume}%"} ) {"${volume}%"}
) )
{" ${round(EWW_CPU["avg"], 0)}%"} {" ${round(EWW_CPU["avg"], 0)}%"}
{" ${round(EWW_RAM["used_mem_perc"], 0)}%"} {" ${round(EWW_RAM["used_mem_perc"], 0)}%"}
; TODO: have these "widgets" be omitted entirely instead of just empty strings ; TODO: have these "widgets" be omitted entirely instead of just empty strings
{(showBrightness == "true") ? (" ${brightness}%") : ""} {(showBrightness == "true") ? (" ${brightness}%") : ""}
{(showBattery == "true") ? ("󱊣 ${EWW_BATTERY["BAT1"]["capacity"]}% (${batteryTime})") : ""} {(showBattery == "true") ? ("󱊣 ${EWW_BATTERY["BAT1"]["capacity"]}% (${batteryTime})") : ""}

View file

@ -63,7 +63,7 @@ workspaces
# listen to events and re-render # listen to events and re-render
while true; do while true; do
# TODO: not sure why this socat | read invocation seems to stop? # TODO: not sure why this socat | read invocation seems to stop?
socat - "UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | while read -r line; do socat - "UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | while read -r line; do
workspaces "$line" workspaces "$line"
done done
done done

View file

@ -0,0 +1,6 @@
{...}: {
programs.eww = {
enable = true;
configDir = ./eww;
};
}

View file

@ -61,9 +61,6 @@ end
function _last_cmd_duration function _last_cmd_duration
set_color -b normal green set_color -b normal green
set -q CMD_DURATION && printf " %dms" $CMD_DURATION set -q CMD_DURATION && printf " %dms" $CMD_DURATION
if test $CMD_DURATION -gt 5000
printf "\e]777;notify;%s;%s\e\\" "WezTerm: Command Finished" (history --max 1)
end
end end
function _maybe_jobs_summary function _maybe_jobs_summary

View file

@ -33,7 +33,7 @@ set --export --universal EXA_COLORS '*=0'
set --export --universal ERL_AFLAGS "-kernel shell_history enabled -kernel shell_history_file_bytes 1024000" set --export --universal ERL_AFLAGS "-kernel shell_history enabled -kernel shell_history_file_bytes 1024000"
set --export --universal BROWSER (which firefox) set --export --universal BROWSER firefox
set --export --universal SOPS_AGE_KEY_FILE "$XDG_CONFIG_HOME/sops/age/keys.txt" set --export --universal SOPS_AGE_KEY_FILE "$XDG_CONFIG_HOME/sops/age/keys.txt"
@ -42,8 +42,6 @@ if has_command skim
set --export --universal SKIM_CTRL_T_COMMAND "fd --hidden" set --export --universal SKIM_CTRL_T_COMMAND "fd --hidden"
end end
set --export --universal NEWT_COLORS "root=black,black:border=black,blue"
# colors # colors
set -U fish_color_normal normal # default color set -U fish_color_normal normal # default color
set -U fish_color_command white # base command being run (>ls< -la) set -U fish_color_command white # base command being run (>ls< -la)

View file

@ -1,16 +1,24 @@
{ {
pkgs, pkgs,
style, colors,
config, config,
lib, lib,
# font, # font,
... ...
}: let }: {
inherit (style) colors; imports = [
in { ./ewwbar.nix
# TODO: Hyprland seems to sometimes use a ton of CPU? # ./mako.nix
./swaylock.nix
# TODO: figure out how to import this for this module _and_ for the sway module?
./linux-desktop.nix
];
# TODO: Hyprland seems to have issues with resuming from hibernation on my
# laptop where it uses a ton of CPU.
home.packages = with pkgs; [ home.packages = with pkgs; [
# TODO: integrate osd
swayosd swayosd
]; ];
@ -37,14 +45,40 @@ in {
exec-once = [ exec-once = [
"hyprpaper" "hyprpaper"
"mako" # "mako"
"swayosd-server" "swayosd-server"
"eww daemon" "eww daemon && eww open bar$EWW_BAR_MON"
"[workspace 1 silent] firefox" "firefox"
"[workspace 1 silent] wezterm" "wezterm"
"xwaylandvideobridge" "xwaylandvideobridge"
"dbus-update-activation-environment --systemd --all"
"systemctl --user import-environment QT_QPA_PLATFORMTHEME" "systemctl --user import-environment QT_QPA_PLATFORMTHEME"
"hypridle" # "wezterm"
# NOTE: maybe check out hypridle?
(lib.concatStringsSep " " [
"swayidle -w"
"timeout 300 'notify-send \"Idling in 300 seconds\"' resume 'notify-send \"Idling cancelled.\"'"
"timeout 480 'notify-send -u critical \"Idling in 120 seconds\"'"
"timeout 510 'notify-send -u critical \"Idling in 90 seconds\"'"
"timeout 540 'notify-send -u critical \"Idling in 60 seconds!\"'"
"timeout 570 'notify-send -u critical \"Idling in 30 seconds!\"'"
"timeout 590 'notify-send -u critical \"Idling in 10 seconds!\"'"
"timeout 591 'notify-send -u critical \"Idling in 9 seconds!\"'"
"timeout 592 'notify-send -u critical \"Idling in 8 seconds!\"'"
"timeout 593 'notify-send -u critical \"Idling in 7 seconds!\"'"
"timeout 594 'notify-send -u critical \"Idling in 6 seconds!\"'"
"timeout 595 'notify-send -u critical \"Idling in 5 seconds!\"'"
"timeout 596 'notify-send -u critical \"Idling in 4 seconds!\"'"
"timeout 597 'notify-send -u critical \"Idling in 3 seconds!\"'"
"timeout 598 'notify-send -u critical \"Idling in 2 seconds!\"'"
"timeout 599 'notify-send -u critical \"Idling in 1 second!\"'"
"timeout 600 'swaylock --daemonize'"
"timeout 600 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on'"
"after-resume 'maybe-good-morning'"
"before-sleep 'swaylock --daemonize'"
])
''swayidle -w timeout 600 'notify-send "Locking in 30 seconds..."' timeout 630 'swaylock -f' timeout 660 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on && maybe-good-morning' before-sleep 'swaylock -f'"''
"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
]; ];
env = [ env = [
@ -54,17 +88,14 @@ in {
input = { input = {
kb_layout = "us"; kb_layout = "us";
kb_options = "ctrl:nocaps"; kb_options = "ctrl:nocaps";
# kb_variant =
/* # kb_model =
kb_variant = # kb_rules =
kb_model =
kb_rules =
*/
follow_mouse = 2; follow_mouse = 2;
repeat_delay = 180; repeat_delay = 200;
repeat_rate = 120; repeat_rate = 60;
touchpad = { touchpad = {
natural_scroll = "yes"; natural_scroll = "yes";
@ -83,10 +114,6 @@ in {
allow_workspace_cycles = true; allow_workspace_cycles = true;
}; };
cursor = {
no_warps = true;
};
general = { general = {
# See https://wiki.hyprland.org/Configuring/Variables/ for more # See https://wiki.hyprland.org/Configuring/Variables/ for more
"col.active_border" = "0xff${colors.primary} 0xff${colors.green} 45deg"; "col.active_border" = "0xff${colors.primary} 0xff${colors.green} 45deg";
@ -95,6 +122,7 @@ in {
gaps_in = 3; gaps_in = 3;
gaps_out = 6; gaps_out = 6;
border_size = 2; border_size = 2;
no_cursor_warps = true;
resize_on_border = true; resize_on_border = true;
no_focus_fallback = true; no_focus_fallback = true;
@ -102,21 +130,16 @@ in {
}; };
decoration = { decoration = {
rounding = 5; rounding = 3;
# blur = "no";
# blur_size = 3
# blur_passes = 1
# blur_new_optimizations = on
/* drop_shadow = "yes";
blur = "no"; shadow_range = 4;
blur_size = 3 shadow_render_power = 3;
blur_passes = 1 "col.shadow" = "rgba(1a1a1aee)";
blur_new_optimizations = on
*/
shadow = {
enabled = true;
color = "rgba(1a1a1aee)";
range = 4;
render_power = 3;
};
dim_inactive = false; dim_inactive = false;
}; };
@ -124,10 +147,8 @@ in {
"$mod" = "SUPER"; "$mod" = "SUPER";
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, kitty" "$mod SHIFT, return, exec, kitty"
"$mod, U, exec, firefox" "$mod, U, exec, firefox"
@ -150,10 +171,10 @@ in {
"$mod, l, movefocus, r" "$mod, l, movefocus, r"
"$mod, k, movefocus, u" "$mod, k, movefocus, u"
"$mod, j, movefocus, d" "$mod, j, movefocus, d"
"$mod SHIFT, H, movewindow, l" "$mod SHIFT, H, swapwindow, l"
"$mod SHIFT, L, movewindow, r" "$mod SHIFT, L, swapwindow, r"
"$mod SHIFT, K, movewindow, u" "$mod SHIFT, K, swapwindow, u"
"$mod SHIFT, J, movewindow, d" "$mod SHIFT, J, swapwindow, d"
"$mod SHIFT, V, exec, swayosd-client --input-volume mute-toggle" "$mod SHIFT, V, exec, swayosd-client --input-volume mute-toggle"
", XF86AudioMicMute, exec, swayosd-client --input-volume mute-toggle" ", XF86AudioMicMute, exec, swayosd-client --input-volume mute-toggle"
@ -199,10 +220,10 @@ in {
# Scroll through existing workspaces with mod + scroll # Scroll through existing workspaces with mod + scroll
"$mod, mouse_down, workspace, e+1" "$mod, mouse_down, workspace, e+1"
"$mod, mouse_up, workspace, e-1" "$mod, mouse_up, workspace, e-1"
"CTRL SHIFT $mod, L, exec, hyprlock" "CTRL SHIFT $mod, L, exec, swaylock"
"$mod CTRL, space, exec, makoctl dismiss" "$mod CTRL, space, exec, makoctl dismiss"
"$mod SHIFT CTRL, space, exec, makoctl restore" "$mod SHIFT CTRL, space, exec, makoctl restore"
"$mod SHIFT, space, exec, makoctl invoke default" "$mod SHIFT, space, exec, makoctl invoke"
"$mod, E, exec, thunar" "$mod, E, exec, thunar"
]; ];
@ -230,12 +251,12 @@ in {
# master switch for pseudotiling. Enabling is bound to mod + P in the keybinds section below # master switch for pseudotiling. Enabling is bound to mod + P in the keybinds section below
pseudotile = yes pseudotile = yes
preserve_split = 1 preserve_split = 1
# no_gaps_when_only = true no_gaps_when_only = true
} }
master { master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
# new_is_master = true new_is_master = true
} }
gestures { gestures {
@ -243,178 +264,22 @@ in {
workspace_swipe = on workspace_swipe = on
} }
## Example per-device config # Example per-device config
## See https://wiki.hyprland.org/Configuring/Keywords/#executing for more # See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
## device:epic-mouse-v1 { # device:epic-mouse-v1 {
## sensitivity = -0.5 # sensitivity = -0.5
## } # }
## See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
windowrulev2 = idleinhibit,class:^.*([Ss]lippi).*$ windowrulev2 = idleinhibit,class:^.*([Ss]lippi).*$
windowrulev2 = float,class:^.*$ windowrulev2 = float,class:^.*([Kk]itty|[Ff]irefox|[Ww]ezterm|[Dd]iscord|[Ss]potify|[Ss]lack).*$
windowrulev2 = tile,class:^.*([Kk]itty|[Ff]irefox|[Ww]ezterm|[Dd]iscord|[Ss]potify|[Ss]lack).*$ windowrulev2 = opacity 1.0 0.9,floating:1
windowrulev2 = opacity 1.0 0.95,class:^.*$
windowrulev2 = center 1,floating:1
windowrulev2 = opacity 0.0 override, class:^(xwaylandvideobridge)$ windowrulev2 = opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$
windowrulev2 = noanim, class:^(xwaylandvideobridge)$ windowrulev2 = noanim,class:^(xwaylandvideobridge)$
windowrulev2 = noinitialfocus, class:^(xwaylandvideobridge)$ windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$
windowrulev2 = maxsize 1 1, class:^(xwaylandvideobridge)$ windowrulev2 = maxsize 1 1,class:^(xwaylandvideobridge)$
windowrulev2 = noblur, class:^(xwaylandvideobridge)$ windowrulev2 = noblur,class:^(xwaylandvideobridge)$
windowrulev2 = nofocus, class:^(xwaylandvideobridge)$
''; '';
}; };
programs.hyprlock = {
enable = true;
settings = {
# docs: https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock
general = {
grace = 0;
no_face_out = true;
};
input-field = [
{
monitor = "";
fade_on_empty = false;
placeholder_text = "Locked";
rounding = 5;
font_size = 20;
font_color = "rgba(255, 255, 255, 1.0)";
inner_color = "rgba(31, 31, 47, 0.95)";
outer_color = "0xff74c7ec 0xff74c7ec 45deg";
outline_thickness = 3;
position = "0, -200";
dots_size = 0.1;
size = "300 75";
font_family = "IosevkaLyteTerm";
shadow_passes = 3;
shadow_size = 8;
shadow_color = "rgba(0, 0, 0, 1.0)";
shadow_boost = 0.8;
}
];
background = [
{
path = "~/.wallpaper";
blur_passes = 2;
}
];
label = [
{
monitor = "";
font_size = 64;
halign = "center";
valign = "center";
text_align = "center";
# rotate = 10;
position = "0, 200";
font_family = "IosevkaLyteTerm";
text = ''Locked for <span foreground="##74c7ec">$USER</span>'';
shadow_passes = 1;
shadow_size = 8;
shadow_color = "rgba(0, 0, 0, 1.0)";
shadow_boost = 0.5;
}
{
monitor = "";
font_size = 20;
halign = "center";
valign = "center";
text_align = "center";
color = "rgba(255, 255, 255, 0.5)";
position = "0 120";
font_family = "IosevkaLyteTerm";
text = "cmd[update:1000] date '+%a %b %d %H:%M:%S'";
shadow_passes = 3;
shadow_size = 1;
shadow_color = "rgba(0, 0, 0, 1.0)";
shadow_boost = 1.0;
}
{
monitor = "";
font_size = 200;
halign = "center";
valign = "center";
text_align = "center";
color = "rgba(220, 240, 255, 0.8)";
position = "0 500";
font_family = "NerdFontSymbolsOnly";
text = "󰍁";
shadow_passes = 3;
shadow_size = 1;
shadow_color = "rgba(0, 0, 0, 1.0)";
shadow_boost = 1.0;
}
];
};
};
services.hypridle = let
secondsPerMinute = 60;
lockSeconds = 10 * secondsPerMinute;
in {
enable = true;
settings = {
general = {
after_sleep_cmd = "hyprctl dispatch dpms on";
before_sleep_cmd = "loginctl lock-session";
ignore_dbus_inhibit = false;
lock_cmd = "pidof hyprlock || hyprlock";
};
listener = [
{
timeout = lockSeconds - 300;
on-timeout = ''notify-send "Auto-locking in 5 minutes"'';
on-resume = ''notify-send "Auto-locking cancelled"'';
}
{
timeout = lockSeconds - 180;
on-timeout = ''notify-send "Auto-locking in 3 minutes"'';
}
{
timeout = lockSeconds - 120;
on-timeout = ''notify-send "Auto-locking in 2 minutes"'';
}
{
timeout = lockSeconds - 60;
on-timeout = ''notify-send "Auto-locking in 1 minute"'';
}
{
timeout = lockSeconds - 30;
on-timeout = ''notify-send "Auto-locking in 30 seconds"'';
}
{
timeout = lockSeconds - 10;
on-timeout = ''notify-send -u critical "Auto-locking in 10 seconds"'';
}
{
timeout = lockSeconds;
on-timeout = ''loginctl lock-session'';
}
{
timeout = lockSeconds + 5;
on-timeout = ''hyprctl dispatch dpms off'';
on-resume = ''hyprctl dispatch dpms on'';
}
];
};
};
} }

View file

@ -0,0 +1,32 @@
{
colors,
font,
...
}: {
services.mako = with colors.withHashPrefix; {
enable = false;
anchor = "top-right";
extraConfig = ''
border-size=1
max-visible=5
default-timeout=15000
font=Symbols Nerd Font ${toString font.size},${font.name} ${toString font.size}
anchor=top-right
background-color=${colors.bg}
text-color=${colors.text}
border-color=${colors.primary}
progress-color=${colors.primary}
[urgency=high]
border-color=${urgent}
[urgency=high]
background-color=${urgent}
border-color=${urgent}
text-color=${bg}
'';
};
}

View file

@ -1,6 +1,5 @@
#!/usr/bin/env sh #!/usr/bin/env sh
umask 0077
SUBDIR="${2:-./}" SUBDIR="${2:-./}"
mkdir -p "$NOTES_PATH/$SUBDIR" mkdir -p "$NOTES_PATH/$SUBDIR"
cd "$NOTES_PATH/$SUBDIR" || exit 1 cd "$NOTES_PATH/$SUBDIR" || exit 1

View file

@ -1,127 +0,0 @@
#!/usr/bin/env bash
#
# spark
# https://github.com/holman/spark
#
# Generates sparklines for a set of data.
#
# Here's a good web-based sparkline generator that was a bit of inspiration
# for spark:
#
# https://datacollective.org/sparkblocks
#
# spark takes a comma-separated or space-separated list of data and then prints
# a sparkline out of it.
#
# Examples:
#
# spark 1 5 22 13 53
# # => ▁▁▃▂▇
#
# spark 0 30 55 80 33 150
# # => ▁▂▃▅▂▇
#
# spark -h
# # => Prints the spark help text.
# Generates sparklines.
#
# $1 - The data we'd like to graph.
_echo()
{
if [ "X$1" = "X-n" ]; then
shift
printf "%s" "$*"
else
printf "%s\n" "$*"
fi
}
spark()
{
local n numbers=
# find min/max values
local min=0xffffffff max=0
for n in ${@//,/ }
do
# on Linux (or with bash4) we could use `printf %.0f $n` here to
# round the number but that doesn't work on OS X (bash3) nor does
# `awk '{printf "%.0f",$1}' <<< $n` work, so just cut it off
n=${n%.*}
(( n < min )) && min=$n
(( n > max )) && max=$n
numbers=$numbers${numbers:+ }$n
done
# print ticks
local ticks=(▁ ▂ ▃ ▄ ▅ ▆ ▇ █)
# use a high tick if data is constant
(( min == max )) && ticks=(▅ ▆)
local f=$(( (($max-$min)<<8)/(${#ticks[@]}-1) ))
(( f < 1 )) && f=1
for n in $numbers
do
_echo -n ${ticks[$(( ((($n-$min)<<8)/$f) ))]}
done
_echo
}
# If we're being sourced, don't worry about such things
if [ "$BASH_SOURCE" == "$0" ]; then
# Prints the help text for spark.
help()
{
local spark=$(basename $0)
cat <<EOF
USAGE:
$spark [-h|--help] VALUE,...
EXAMPLES:
$spark 1 5 22 13 53
▁▁▃▂█
$spark 0,30,55,80,33,150
▁▂▃▄▂█
echo 9 13 5 17 1 | $spark
▄▆▂█▁
EOF
}
# show help for no arguments if stdin is a terminal
if { [ -z "$1" ] && [ -t 0 ] ; } || [ "$1" == '-h' ] || [ "$1" == '--help' ]
then
help
exit 0
fi
spark ${@:-`cat`}
fi
# source: https://github.com/holman/spark/commit/ab88ac6f8f33698f39ece2f109b1117ef39a68eb
# The MIT License
#
# Copyright (c) Zach Holman, https://zachholman.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
N todo

View file

@ -1,22 +1,60 @@
{ {
style, colors,
lib, lib,
config, config,
pkgs,
font,
... ...
}: { }: {
imports = [
./waybar.nix
# ./mako.nix
./swaylock.nix
./linux-desktop.nix
];
programs.foot = { programs.foot = {
enable = true; enable = true;
}; };
xdg = { home.file."${config.xdg.configHome}/mako/config" = {
enable = true; enable = true;
mimeApps = { text = with colors.withHashPrefix; ''
border-size=1
max-visible=5
default-timeout=15000
font=Symbols Nerd Font ${toString font.size},${font.name} ${toString font.size}
anchor=top-right
background-color=${bg}
text-color=${text}
border-color=${primary}
progress-color=${primary}
[urgency=high]
border-color=${urgent}
[urgency=high]
background-color=${urgent}
border-color=${urgent}
text-color=${bg}
'';
};
home.file."${config.xdg.configHome}/tofi/config" = {
enable = true; enable = true;
defaultApplications = { text = ''
"x-scheme-handler/http" = "firefox.desktop"; font = ${pkgs.iosevkaLyteTerm}/share/fonts/truetype/IosevkaLyteTerm-regular.ttf
"x-scheme-handler/https" = "firefox.desktop";
}; text-color = #f8f8f8
}; prompt-color = #f38ba8
selection-color = #66d9ef
background-color = #1e1e2e
border-width = 4
border-color = #66d9ef
fuzzy-match = true
'';
}; };
wayland.windowManager.sway = { wayland.windowManager.sway = {
@ -42,17 +80,6 @@
systemd = { systemd = {
enable = true; enable = true;
variables = [
"DISPLAY"
"WAYLAND_DISPLAY"
"SWAYSOCK"
"XDG_CURRENT_DESKTOP"
"XDG_SESSION_TYPE"
"NIXOS_OZONE_WL"
"XCURSOR_THEME"
"XCURSOR_SIZE"
"PATH"
];
}; };
# TODO: stuff is opening on workspace 10 (0?) # TODO: stuff is opening on workspace 10 (0?)
@ -76,6 +103,12 @@
*/ */
]; ];
output = {
# "*" = {
# background = "$HOME/.wallpaper fill";
# };
};
# TODO: popup_during_fullscreen smart # TODO: popup_during_fullscreen smart
focus = { focus = {
wrapping = "no"; # maybe workspace? wrapping = "no"; # maybe workspace?
@ -100,11 +133,6 @@
}; };
startup = [ startup = [
{command = "kdeconnect-indicator";}
{command = "mako";}
{
command = "swaybg -i $HOME/.wallpaper";
}
{ {
command = "swayosd-server"; command = "swayosd-server";
} }
@ -134,6 +162,7 @@
"timeout 600 'swaymsg \"output * dpms off\"' resume 'swaymsg \"output * dpms on\" & maybe-good-morning &'" "timeout 600 'swaymsg \"output * dpms off\"' resume 'swaymsg \"output * dpms on\" & maybe-good-morning &'"
]; ];
} }
# {command = "mako";}
# {command = "firefox";} # {command = "firefox";}
# {command = "wezterm";} # {command = "wezterm";}
]; ];
@ -158,13 +187,13 @@
input = { input = {
"type:keyboard" = { "type:keyboard" = {
xkb_options = "ctrl:nocaps"; xkb_options = "ctrl:nocaps";
repeat_delay = "180"; repeat_delay = "200";
repeat_rate = "100"; repeat_rate = "60";
}; };
"type:pointer" = { "type:pointer" = {
accel_profile = "flat"; accel_profile = "flat";
pointer_accel = "0.5"; pointer_accel = "0";
}; };
"type:touchpad" = { "type:touchpad" = {
@ -188,7 +217,6 @@
"${mod}+c" = "kill"; "${mod}+c" = "kill";
"${mod}+shift+c" = "kill # TODO: kill -9?"; "${mod}+shift+c" = "kill # TODO: kill -9?";
"${mod}+alt+space" = "exec wofi --show drun"; "${mod}+alt+space" = "exec wofi --show drun";
"${mod}" = "exec ${menu}";
"${mod}+space" = "exec ${menu}"; "${mod}+space" = "exec ${menu}";
"${mod}+shift+s" = "exec clipshot"; "${mod}+shift+s" = "exec clipshot";
"${mod}+e" = "exec thunar"; "${mod}+e" = "exec thunar";
@ -266,54 +294,39 @@
# 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}+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";
"${mod}+shift+v" = "exec swayosd-client --input-volume mute-toggle";
# "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume 15";
# "XF86AudioLowerVolume" = "exec swayosd-client --output-volume -15";
# "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise --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";
# "XF86AudioLowerVolume" = "exec swayosd-client --output-volume -10 --device alsa_output.pci-0000_11_00.4.analog-stereo.monitor";
"XF86MonBrightnessUp" = "exec swayosd-client --brightness raise"; "XF86MonBrightnessUp" = "exec swayosd-client --brightness raise";
"XF86MonBrightnessDown" = "exec swayosd-client --brightness lower"; "XF86MonBrightnessDown" = "exec swayosd-client --brightness lower";
# "XF86MonBrightnessUp" = " exec swayosd-client --brightness 10";
# "XF86MonBrightnessDown" = "exec swayosd-client --brightness -10";
# "XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%";
# "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%";
"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%";
# "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
"${mod}+F1" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
# "XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
# "XF86MonBrightnessDown" = "exec brightnessctl set 10%-";
# "XF86MonBrightnessUp" = "exec brightnessctl set +10%";
# "shift+XF86MonBrightnessDown" = "exec brightnessctl set 1%";
# "shift+XF86MonBrightnessUp" = "exec brightnessctl set 100%";
# "control+XF86MonBrightnessDown" = "exec brightnessctl set 1%-";
# "control+XF86MonBrightnessUp" = "exec brightnessctl set +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"; # "${mod}+shift+v" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
"--locked ${mod}+F1" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
"--locked XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise";
"--locked XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower";
"--locked XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle";
"--locked XF86AudioMicMute" = "exec swayosd-client --input-volume mute-toggle";
"--locked XF86MonBrightnessUp" = "exec swayosd-client --brightness raise";
"--locked XF86MonBrightnessDown" = "exec swayosd-client --brightness lower";
"--locked control+XF86AudioRaiseVolume" = "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 XF86AudioNext" = "exec playerctl next";
"--locked XF86AudioPrev" = "exec playerctl previous";
/*
"XF86MonBrightnessUp" = " exec swayosd-client --brightness 10";
"XF86MonBrightnessDown" = "exec swayosd-client --brightness -10";
"XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%";
"XF86AudioRaiseVolume" = "exec swayosd-client --output-volume 15";
"XF86AudioLowerVolume" = "exec swayosd-client --output-volume -15";
"XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise --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";
"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";
"XF86MonBrightnessDown" = "exec brightnessctl set 10%-";
"XF86MonBrightnessUp" = "exec brightnessctl set +10%";
"shift+XF86MonBrightnessDown" = "exec brightnessctl set 1%";
"shift+XF86MonBrightnessUp" = "exec brightnessctl set 100%";
"control+XF86MonBrightnessDown" = "exec brightnessctl set 1%-";
"control+XF86MonBrightnessUp" = "exec brightnessctl set +1%";
"${mod}+shift+v" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
*/
"${mod}+control+shift+l" = "exec swaylock"; "${mod}+control+shift+l" = "exec swaylock";
@ -321,7 +334,7 @@
}; };
assigns = {}; assigns = {};
bars = []; bars = [];
colors = with style.colors; { colors = with colors; {
background = bg; background = bg;
focused = { focused = {
background = bg; background = bg;

View file

@ -1,10 +1,14 @@
{style, ...}: { {
font,
# colors,
...
}: {
programs.swaylock = { programs.swaylock = {
enable = true; enable = true;
settings = { settings = {
color = "ffffffff"; color = "ffffffff";
image = "~/.wallpaper"; image = "~/.wallpaper";
font = style.font.name; font = font.name;
show-failed-attempts = true; show-failed-attempts = true;
ignore-empty-password = true; ignore-empty-password = true;

View file

@ -1,6 +1,6 @@
{ {
pkgs, colors,
style, font,
... ...
}: { }: {
programs.waybar = { programs.waybar = {
@ -10,41 +10,38 @@
"layer" = "top"; "layer" = "top";
"position" = "bottom"; "position" = "bottom";
"output" = ["eDP-1" "DP-3"]; "output" = ["eDP-1" "DP-3"];
"height" = 50; "height" = 32;
"modules-left" = [ "modules-left" = ["clock" "sway/window"];
"idle_inhibitor" "modules-center" = ["sway/workspaces"];
"sway/workspaces"
"sway/window"
];
"modules-center" = [];
"modules-right" = [ "modules-right" = [
"privacy"
"power-profiles-daemon"
"mpris" "mpris"
## "disk" "idle_inhibitor"
## TODO: will need a custom module for Disk IO "bluetooth"
# "wireplumber",
## "wireplumber" # pulseaudio module is more featureful
"pulseaudio" "pulseaudio"
"network" # "network",
"cpu" "cpu"
"memory" "memory"
"temperature" # "temperature",
"backlight" "backlight"
"battery" "battery"
"bluetooth"
"tray" "tray"
"clock"
]; ];
"bluetooth" = { "bluetooth" = {
"format" = "<span></span>"; "format" = "<span</span>";
"on-click" = "${pkgs.blueman}/bin/blueman-manager"; "format-connected" = "<span></span>";
}; "format-connected-battery" = "<span></span>";
"wireplumber" = { # "format-device-preference" = [ "device1", "device2" ], # preference list deciding the displayed devic;
"format" = "{volume}% {icon}"; "tooltip-format" = "{controller_alias}@{controller_address} ({num_connections} connected)";
"on-click" = "helvum"; "tooltip-format-connected" = "{controller_alias}@{controller_address} ({num_connections} connected)\n{device_enumerate}";
"tooltip-format-enumerate-connected" = "{device_alias}@{device_address}";
"tooltip-format-enumerate-connected-battery" = "{device_alias}@{device_address} (󰁹 {device_battery_percentage}%)";
}; };
# "wireplumber" = ;
# "format" = "{volume}% {icon}";
# "format-muted" = "";
# "on-click" = "helvum;
# },
"sway/workspaces" = { "sway/workspaces" = {
"disable-scroll" = false; "disable-scroll" = false;
"persistent_workspaces" = { "persistent_workspaces" = {
@ -62,40 +59,31 @@
"tray" = { "tray" = {
"icon-size" = 24; "icon-size" = 24;
"spacing" = 4; "spacing" = 4;
"show-passive-items" = true;
}; };
"clock" = { "clock" = {
"interval" = 1; "interval" = 1;
"format" = "{:%a %b %d\n%H:%M:%S}"; "format" = "{:%a %b %d %H:%M:%S}";
"justify" = "center";
}; };
"cpu" = { "cpu" = {
"format" = "{usage}%\nCPU"; "format" = "{usage} <span></span>";
"tooltip" = true; "tooltip" = true;
"interval" = 5; "interval" = 3;
"justify" = "center";
}; };
"memory" = { "memory" = {
"format" = "{}%\nRAM"; "format" = "{} 󰍛";
"tooltip" = true;
"interval" = 5;
"justify" = "center";
}; };
"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}";
*/
"critical-threshold" = 80; "critical-threshold" = 80;
"format" = "{temperatureC}\n°C"; # "format-critical" = "{temperatureC}°C {icon}";
"justify" = "center"; "format" = "{temperatureC}°C {icon}";
"format-icons" = ["" "" ""];
}; };
"backlight" = { "backlight" = {
# "device" = "acpi_video1"; # "device" = "acpi_video1";
"format" = "{percent}%\n{icon}"; "format" = "{percent}% {icon}";
"format-icons" = ["" ""]; "format-icons" = ["" ""];
"justify" = "center";
}; };
"battery" = { "battery" = {
"states" = { "states" = {
@ -103,55 +91,55 @@
"warning" = 30; "warning" = 30;
"critical" = 1; "critical" = 1;
}; };
"tooltip-format" = "{timeTo}\n{power} watts\n{health}% health\n{cycles} cycles"; "format" = "{capacity}% {time} {icon}";
"format" = "{icon}{capacity}%-\n{time}"; "format-charging" = "{capacity}% {time} 󱐋";
"format-charging" = "{capacity}%+\n{time}"; "format-plugged" = "{capacity}% {time} 󰚥";
"format-plugged" = "{capacity}%=\n{time}"; "format-alt" = "{capacity}% {icon}";
"format-alt" = "{capacity}%";
"format-good" = ""; # An empty format will hide the module "format-good" = ""; # An empty format will hide the module
"format-time" = "{H}:{m}"; "format-full" = "󰁹";
"justify" = "center"; "format-icons" = ["󰂎" "󰁻" "󰁽" "󰁿" "󰂂"];
}; };
"network" = { "network" = {
"format-wifi" = "{bandwidthUpBits} up \n{bandwidthDownBits} down"; "format-wifi" = "{essid} ({signalStrength}%) ";
"format-ethernet" = "{bandwidthUpBits} up \n{bandwidthDownBits} down"; "format-ethernet" = "{ifname}: {ipaddr}/{cidr} ";
"format-linked" = "{bandwidthUpBits} up \n{bandwidthDownBits} down"; "format-linked" = "{ifname} (No IP) ";
"format-disconnected" = "No Network {icon}"; "format-disconnected" = "Disconnected ";
"format-alt" = "{bandwidthUpBits} up \n{bandwidthDownBits} down"; "format-alt" = "{ifname}: {ipaddr}/{cidr}";
"interval" = 5;
"justify" = "right";
}; };
"mpris" = { "mpris" = {
"format" = "{title}\nby {artist}"; "format" = "{title} by {artist}";
"title-len" = 64;
"artist-len" = 61;
"justify" = "center";
}; };
"pulseaudio" = { "pulseaudio" = {
/* # "scroll-step" = 1, # %, can be a floa;
"scroll-step" = 1, # %, can be a floa; "format" = "{volume} {icon} <span>{format_source}</span>";
"format" = "{volume}% {icon} {format_source}"; #"format" = "{volume}% {icon} {format_source}";
"format-muted" = " {format_source}"; #"format-bluetooth" = "{volume}% {icon} {format_source}";
*/ #"format-bluetooth-muted" = " {icon} {format_source}";
"format" = "{volume}%\n{format_source}"; #"format-muted" = " {format_source}";
"format-muted" = "MUTE\n{format_source}"; "format-muted" = "󰝟 {format_source}";
"format-bluetooth" = "{volume}%\n{format_source}"; "format-source" = "";
"format-bluetooth-muted" = "MUTE\n{format_source}"; "format-source-muted" = "";
"format-source" = "MIC ON"; "format-icons" = {
"format-source-muted" = "MIC OFF"; "headphones" = "";
"handsfree" = "󱥋";
"headset" = "󰋎";
"phone" = "";
"portable" = "";
"car" = "";
"default" = ["" "" ""];
};
# TODO: toggle mute? # TODO: toggle mute?
"on-click" = "${pkgs.pavucontrol}/bin/pavucontrol"; "on-click" = "pavucontrol";
"justify" = "center";
}; };
}; };
}; };
style = let style = let
border-width = "0px"; border-width = "0px";
in in
with style.colors.withHashPrefix; '' with colors.withHashPrefix; ''
* { * {
border-radius: 0; border-radius: 0;
font-family: "${style.font.name}", "Symbols Nerd Font Mono", sans-serif; font-family: "${font.name}", "Symbols Nerd Font Mono", sans-serif;
font-size: 16px; font-size: 16px;
} }

View file

@ -4,7 +4,6 @@ if wezterm.config_builder then
config = wezterm.config_builder() config = wezterm.config_builder()
end end
config.adjust_window_size_when_changing_font_size = false
config.font = wezterm.font_with_fallback { config.font = wezterm.font_with_fallback {
{ family = "IosevkaLyteTerm", weight = 'Medium', italic = false }, { family = "IosevkaLyteTerm", weight = 'Medium', italic = false },
{ family = 'Symbols Nerd Font Mono', weight = 'Regular', italic = false }, { family = 'Symbols Nerd Font Mono', weight = 'Regular', italic = false },
@ -22,12 +21,8 @@ config.tab_bar_at_bottom = true
config.window_background_opacity = 1.0 config.window_background_opacity = 1.0
config.enable_kitty_keyboard = true config.enable_kitty_keyboard = true
config.show_new_tab_button_in_tab_bar = true config.show_new_tab_button_in_tab_bar = true
config.notification_handling = "SuppressFromFocusedTab"
-- config.front_end = "WebGpu" -- config.front_end = "WebGpu"
-- config.webgpu_power_preference = 'HighPerformance'
config.enable_wayland = true
-- config.use_ime = true
local function tab_title(tab_info) local function tab_title(tab_info)
local title = tab_info.tab_title local title = tab_info.tab_title

View file

@ -1,7 +1,7 @@
{ {
disko, disko,
sops-nix, sops-nix,
style, colors,
flakeInputs, flakeInputs,
homeManagerModules, homeManagerModules,
home-manager, home-manager,
@ -11,147 +11,6 @@
pubkey, pubkey,
overlays, overlays,
}: { }: {
ewwbar = {pkgs, ...}: {
# imports = with nixosModules; [];
environment.systemPackages = with pkgs; [eww upower jq];
# TODO: include the home-manager modules for daniel?
};
hyprland = {pkgs, ...}: {
imports = with nixosModules; [
ewwbar
pipewire
];
programs.hyprland = {
enable = true;
};
environment.systemPackages = with pkgs; [hyprpaper xwaylandvideobridge socat];
programs.hyprland = {
package = flakeInputs.hyprland.packages.${pkgs.system}.hyprland;
};
home-manager.users.daniel = {
imports = with homeManagerModules; [
hyprland
];
};
# TODO: include the home-manager modules for daniel?
};
sway = {pkgs, ...}: {
imports = with nixosModules; [
pipewire
];
systemd.user.services."wait-for-full-path" = {
description = "wait for systemd units to have full PATH";
wantedBy = ["xdg-desktop-portal.service"];
before = ["xdg-desktop-portal.service"];
path = with pkgs; [systemd coreutils gnugrep];
script = ''
ispresent () {
systemctl --user show-environment | grep -E '^PATH=.*/.nix-profile/bin'
}
while ! ispresent; do
sleep 0.1;
done
'';
serviceConfig = {
Type = "oneshot";
TimeoutStartSec = "60";
};
};
home-manager.users.daniel = {
imports = with homeManagerModules; [
sway
];
};
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
# services.xserver.libinput.enable = true;
# TODO: a lot of this probably needs de-duping with hyprland?
services.gnome.gnome-keyring.enable = true;
xdg.portal = {
enable = true;
wlr.enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
];
};
services.dbus.enable = true;
security.polkit.enable = true; # needed for home-manager integration
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [thunar-archive-plugin thunar-volman];
};
services.gvfs = {
enable = true;
};
environment = {
variables = {
VISUAL = "hx";
};
systemPackages = with pkgs; [
brightnessctl
feh
grim
libinput
libinput-gestures
libnotify
mako
noto-fonts
pamixer
playerctl
pulseaudio
pulsemixer
slurp
swaybg
swayidle
swaylock
swayosd
tofi
waybar
wl-clipboard
zathura
/*
gimp
inkscape
krita
lutris
nil
nixpkgs-fmt
pavucontrol
rclone
restic
steam
vlc
vulkan-tools
weechat
wine
*/
];
};
};
deno-netlify-ddns-client = import ./deno-netlify-ddns-client.nix; deno-netlify-ddns-client = import ./deno-netlify-ddns-client.nix;
fallback-hostname = {lib, ...}: { fallback-hostname = {lib, ...}: {
@ -195,9 +54,22 @@
}; };
}; };
less-pager = {pkgs, ...}: {
environment = {
systemPackages = [
pkgs.less
];
variables = {
PAGER = "less";
MANPAGER = "less";
};
};
};
helix-text-editor = {pkgs, ...}: { helix-text-editor = {pkgs, ...}: {
environment = { environment = {
systemPackages = [ systemPackages = [
pkgs.less
helix.packages.${pkgs.system}.helix helix.packages.${pkgs.system}.helix
]; ];
variables = { variables = {
@ -237,36 +109,28 @@
my-favorite-default-system-apps = {pkgs, ...}: { my-favorite-default-system-apps = {pkgs, ...}: {
imports = with nixosModules; [ imports = with nixosModules; [
less-pager
helix-text-editor helix-text-editor
zellij-multiplexer zellij-multiplexer
fish-shell fish-shell
]; ];
environment = { environment.systemPackages = with pkgs; [
variables = {
PAGER = "bat --style=plain";
MANPAGER = "bat --style=plain";
};
systemPackages = with pkgs; [
curl curl
dua dua
bat eza # TODO: needs shell aliases
eza
fd fd
file file
iputils iputils
nettools nettools
/* # nodePackages.bash-language-server # just pull in as needed?
nodePackages.bash-language-server # just pull in as needed? # shellcheck
shellcheck # shfmt
shfmt
*/
killall killall
ripgrep ripgrep
rsync rsync
sd sd
]; ];
};
programs = { programs = {
traceroute.enable = true; traceroute.enable = true;
@ -290,11 +154,9 @@
pkgs, pkgs,
... ...
}: { }: {
/* # https://nixos.wiki/wiki/Remote_disk_unlocking
https://nixos.wiki/wiki/Remote_disk_unlocking # "When using DHCP, make sure your computer is always attached to the network and is able to get an IP adress, or the boot process will hang."
"When using DHCP, make sure your computer is always attached to the network and is able to get an IP adress, or the boot process will hang." # ^ seems less than ideal
^ seems less than ideal
*/
boot.kernelParams = ["ip=dhcp"]; boot.kernelParams = ["ip=dhcp"];
boot.initrd = { boot.initrd = {
# availableKernelModules = ["r8169"]; # ethernet drivers # availableKernelModules = ["r8169"]; # ethernet drivers
@ -324,26 +186,22 @@
settings = { settings = {
PasswordAuthentication = false; PasswordAuthentication = false;
KbdInteractiveAuthentication = false; KbdInteractiveAuthentication = false;
PermitRootLogin = lib.mkForce "prohibit-password"; PermitRootLogin = "prohibit-password";
}; };
openFirewall = lib.mkDefault true; openFirewall = lib.mkDefault true;
/* # listenAddresses = [
listenAddresses = [ # { addr = "0.0.0.0"; port = 22; }
{ addr = "0.0.0.0"; port = 22; } # ];
];
*/
}; };
}; };
password-manager = {pkgs, ...}: { password-manager = {pkgs, ...}: {
/* # programs.goldwarden = {
programs.goldwarden = { # NOTE: This didn't seem to work for me, but would be awesome!
## NOTE: This didn't seem to work for me, but would be awesome! (but I can't remember why?) # enable = true;
enable = true; # };
};
*/
home-manager.users.daniel = { home-manager.users.daniel = {
imports = with homeManagerModules; [ imports = with homeManagerModules; [
@ -367,10 +225,6 @@
}; };
}; };
cross-compiler = {config, ...}: {
boot.binfmt.emulatedSystems = ["aarch64-linux" "i686-linux"];
};
default-nix-configuration-and-overlays = { default-nix-configuration-and-overlays = {
lib, lib,
config, config,
@ -393,14 +247,12 @@
trusted-users = ["root" "daniel"]; trusted-users = ["root" "daniel"];
experimental-features = lib.mkDefault ["nix-command" "flakes"]; experimental-features = lib.mkDefault ["nix-command" "flakes"];
extra-platforms = ["i686-linux" "aarch64-linux"];
substituters = [ substituters = [
# TODO: dedupe with flake's config? is that even necessary? # TODO: dedupe with flake's config? is that even necessary?
"https://cache.nixos.org/" "https://cache.nixos.org/"
"https://helix.cachix.org" "https://helix.cachix.org"
"https://nix-community.cachix.org" "https://nix-community.cachix.org"
"https://nix.h.lyte.dev" # "https://nix.h.lyte.dev"
"https://hyprland.cachix.org" "https://hyprland.cachix.org"
]; ];
trusted-public-keys = [ trusted-public-keys = [
@ -426,19 +278,6 @@
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness" ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness" ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness"
''; '';
services.upower.enable = true;
# NOTE: I previously let plasma settings handle this
services.logind = {
lidSwitch = "suspend-then-hibernate";
extraConfig = ''
HandleLidSwitchDocked=ignore
HandlePowerKey=suspend-then-hibernate
IdleActionSec=11m
IdleAction=suspend-then-hibernate
'';
};
}; };
emacs = {pkgs, ...}: { emacs = {pkgs, ...}: {
@ -453,11 +292,7 @@
}; };
}; };
development-tools = { development-tools = {pkgs, ...}: {
pkgs,
lib,
...
}: {
imports = with nixosModules; [ imports = with nixosModules; [
postgres postgres
podman podman
@ -468,20 +303,18 @@
environment.sessionVariables.NIXOS_OZONE_WL = "1"; environment.sessionVariables.NIXOS_OZONE_WL = "1";
programs.neovim = { programs.neovim = {
enable = true; enable = true;
/* # plugins = [
plugins = [ # pkgs.vimPlugins.nvim-treesitter.withAllGrammars
pkgs.vimPlugins.nvim-treesitter.withAllGrammars # ];
];
*/
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
taplo # toml language server for editing helix configs per repo taplo # toml language server for editing helix configs per repo
picocom # serial
pgcli pgcli
oils-for-unix oil
watchexec watchexec
android-tools android-tools
kubectl
stern stern
libresprite libresprite
# logseq # logseq
@ -521,17 +354,6 @@
yubico-piv-tool yubico-piv-tool
]; ];
programs.direnv.mise = {
enable = true;
};
programs.mise = {
enable = true;
enableFishIntegration = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
programs.thunderbird = { programs.thunderbird = {
enable = true; enable = true;
@ -548,7 +370,7 @@
}; };
programs.jujutsu = { programs.jujutsu = {
enable = lib.mkDefault true; enable = true;
}; };
programs.k9s = { programs.k9s = {
@ -578,8 +400,6 @@
troubleshooting-tools = {pkgs, ...}: { troubleshooting-tools = {pkgs, ...}: {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
comma
iftop
bottom bottom
btop btop
dnsutils dnsutils
@ -591,7 +411,6 @@
hexyl hexyl
pkgs.unixtools.xxd pkgs.unixtools.xxd
usbutils usbutils
comma
]; ];
}; };
@ -613,13 +432,6 @@
}; };
}; };
android-dev = {pkgs, ...}: {
services.udev.packages = [
pkgs.android-udev-rules
];
environment.systemPackages = [pkgs.android-studio];
};
graphical-workstation = { graphical-workstation = {
pkgs, pkgs,
lib, lib,
@ -628,16 +440,13 @@
... ...
}: { }: {
imports = with nixosModules; [ imports = with nixosModules; [
sway plasma6
hyprland
enable-flatpaks-and-appimages enable-flatpaks-and-appimages
fonts fonts
development-tools development-tools
printing printing
music-consumption music-consumption
video-tools video-tools
radio-tools
android-dev
]; ];
xdg.portal.enable = true; xdg.portal.enable = true;
@ -647,11 +456,8 @@
then { then {
graphics = { graphics = {
enable = true; enable = true;
enable32Bit = true; # driSupport32Bit = true;
/* # driSupport = true;
driSupport32Bit = true;
driSupport = true;
*/
}; };
} }
else { else {
@ -665,49 +471,31 @@
systemPackages = with pkgs; [ systemPackages = with pkgs; [
libnotify libnotify
slides slides
slack
discord
]; ];
variables = { variables = {
/* # GTK_THEME = "Catppuccin-Mocha-Compact-Sapphire-Dark";
GTK_THEME = "Catppuccin-Mocha-Compact-Sapphire-Dark"; # GTK_USE_PORTAL = "1";
GTK_USE_PORTAL = "1";
*/
}; };
}; };
}; };
# ewwbar = {};
# gnome = {}; # gnome = {};
# hyprland = {};
# intel = {}; # intel = {};
radio-tools = {pkgs, ...}: {
environment = {
systemPackages = with pkgs; [
chirp
];
};
};
kde-connect = { kde-connect = {
programs.kdeconnect.enable = true; programs.kdeconnect.enable = true;
/* # networking.firewall = {
# handled by enabling # allowedTCPPortRanges = [ { from = 1714; to = 1764; } ];
networking.firewall = { # allowedUDPPortRanges = [ { from = 1714; to = 1764; } ];
allowedTCPPortRanges = [ { from = 1714; to = 1764; } ]; # };
allowedUDPPortRanges = [ { from = 1714; to = 1764; } ];
};
*/
}; };
fonts = {pkgs, ...}: { fonts = {pkgs, ...}: {
fonts.packages = [ fonts.packages = with pkgs; [
( (nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
# allow nixpkgs 24.11 and unstable to both work
if builtins.hasAttr "nerd-fonts" pkgs
then (pkgs.nerd-fonts.symbols-only)
else (pkgs.nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
)
pkgs.iosevkaLyteTerm pkgs.iosevkaLyteTerm
]; ];
}; };
@ -747,27 +535,24 @@
maliit-framework maliit-framework
kdePackages.kate kdePackages.kate
# kdePackages.kdenlive
# kdePackages.merkuro
kdePackages.kcalc kdePackages.kcalc
# kdePackages.neochat
kdePackages.filelight kdePackages.filelight
kdePackages.krdc kdePackages.krdc
kdePackages.krfb kdePackages.krfb
kdePackages.kclock kdePackages.kclock
kdePackages.kweather kdePackages.kweather
kdePackages.ktorrent kdePackages.ktorrent
# kdePackages.kdevelop
# kdePackages.kdialog
kdePackages.kdeplasma-addons kdePackages.kdeplasma-addons
unstable-packages.kdePackages.krdp unstable-packages.kdePackages.krdp
/*
kdePackages.kdenlive
kdePackages.merkuro
kdePackages.neochat
kdePackages.kdevelop
kdePackages.kdialog
*/
]; ];
programs.gnupg.agent.pinentryPackage = lib.mkForce pkgs.pinentry-qt; programs.gnupg.agent.pinentryPackage = pkgs.pinentry-tty;
}; };
lutris = {pkgs, ...}: { lutris = {pkgs, ...}: {
@ -845,56 +630,50 @@
} }
]; ];
}; };
/* # extraConfig.pipewire."92-low-latency" = {
extraConfig.pipewire."92-low-latency" = { # context.properties = {
context.properties = { # default.clock.rate = 48000;
default.clock.rate = 48000; # default.clock.quantum = 32;
default.clock.quantum = 32; # default.clock.min-quantum = 32;
default.clock.min-quantum = 32; # default.clock.max-quantum = 32;
default.clock.max-quantum = 32; # };
}; # };
};
*/
}; };
# recommended by https://nixos.wiki/wiki/PipeWire # recommended by https://nixos.wiki/wiki/PipeWire
security.rtkit.enable = true; security.rtkit.enable = true;
/* # services.pipewire = {
services.pipewire = { # enable = true;
enable = true;
wireplumber.enable = true; # wireplumber.enable = true;
pulse.enable = true; # pulse.enable = true;
jack.enable = true; # jack.enable = true;
alsa = { # alsa = {
enable = true; # enable = true;
support32Bit = true; # support32Bit = true;
}; # };
}; # };
hardware = { # hardware = {
pulseaudio = { # pulseaudio = {
enable = false; # enable = false;
support32Bit = true; # support32Bit = true;
}; # };
}; # };
security = { # security = {
# I forget why I need these exactly... # # I forget why I need these exactly...
polkit.enable = true; # polkit.enable = true;
rtkit.enable = true; # rtkit.enable = true;
}; # };
*/
}; };
music-production = {pkgs, ...}: { music-production = {pkgs, ...}: {
/* # TODO: may want to force nixpkgs-stable for a more-stable music production
TODO: may want to force nixpkgs-stable for a more-stable music production # environment?
environment?
*/
imports = [ imports = [
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
@ -905,12 +684,11 @@
} }
]; ];
/* # TODO: things to look into for music production:
TODO: things to look into for music production: # - https://linuxmusicians.com/viewtopic.php?t=27016
- https://linuxmusicians.com/viewtopic.php?t=27016 # - KXStudio?
- KXStudio? # - falktx (https://github.com/DISTRHO/Cardinal)
- falktx (https://github.com/DISTRHO/Cardinal) # -
*/
}; };
podman = {pkgs, ...}: { podman = {pkgs, ...}: {
@ -933,24 +711,6 @@
backend = "podman"; backend = "podman";
}; };
}; };
networking = {
extraHosts = ''
127.0.0.1 host.docker.internal
::1 host.docker.internal
127.0.0.1 host.containers.internal
::1 host.containers.internal
'';
};
};
virtual-machines = {pkgs, ...}: {
virtualisation.libvirtd.enable = true;
users.users.daniel.extraGroups = ["libvirtd"];
};
virtual-machines-gui = {pkgs, ...}: {
programs.virt-manager.enable = true;
}; };
postgres = {pkgs, ...}: { postgres = {pkgs, ...}: {
@ -1011,6 +771,8 @@
services.printing.drivers = [pkgs.gutenprint]; services.printing.drivers = [pkgs.gutenprint];
}; };
sway = {};
enable-flatpaks-and-appimages = { enable-flatpaks-and-appimages = {
services.flatpak.enable = true; services.flatpak.enable = true;
programs.appimage.binfmt = true; programs.appimage.binfmt = true;
@ -1019,37 +781,12 @@
wifi = {lib, ...}: let wifi = {lib, ...}: let
inherit (lib) mkDefault; inherit (lib) mkDefault;
in { in {
networking.networkmanager = { networking.networkmanager.enable = mkDefault true;
enable = mkDefault true;
# ensureProfiles = {
# profiles = {
# home-wifi = {
# id="home-wifi";
# permissions = "";
# type = "wifi";
# };
# wifi = {
# ssid = "";
# };
# wifi-security = {
# # auth-alg = "";
# # key-mgmt = "";
# psk = "";
# };
# };
# };
};
systemd.services.NetworkManager-wait-online.enable = mkDefault false; systemd.services.NetworkManager-wait-online.enable = mkDefault false;
/* # TODO: networking.networkmanager.wifi.backend = "iwd"; ?
TODO: networking.networkmanager.wifi.backend = "iwd"; ? # TODO: powersave?
TODO: powersave? # TODO: can I pre-configure my usual wifi networks with SSIDs and PSKs loaded from secrets?
TODO: can I pre-configure my usual wifi networks with SSIDs and PSKs loaded from secrets?
*/
hardware.wirelessRegulatoryDatabase = true;
boot.extraModprobeConfig = ''
options cfg80211 ieee80211_regdom="US"
'';
}; };
steam = {pkgs, ...}: { steam = {pkgs, ...}: {
@ -1057,15 +794,12 @@
programs.steam = { programs.steam = {
enable = true; enable = true;
# extest.enable = true;
# gamescopeSession.enable = true;
/* # extraPackages = with pkgs; [
extest.enable = true; # gamescope
gamescopeSession.enable = true; # ];
extraPackages = with pkgs; [
gamescope
];
*/
extraCompatPackages = with pkgs; [ extraCompatPackages = with pkgs; [
proton-ge-bin proton-ge-bin
@ -1083,10 +817,8 @@
]; ];
# remote play ports - should be unnecessary due to programs.steam.remotePlay.openFirewall = true; # remote play ports - should be unnecessary due to programs.steam.remotePlay.openFirewall = true;
/* # networking.firewall.allowedUDPPortRanges = [ { from = 27031; to = 27036; } ];
networking.firewall.allowedUDPPortRanges = [ { from = 27031; to = 27036; } ]; # networking.firewall.allowedTCPPortRanges = [ { from = 27036; to = 27037; } ];
networking.firewall.allowedTCPPortRanges = [ { from = 27036; to = 27037; } ];
*/
}; };
root = { root = {
@ -1121,7 +853,7 @@
createHome = true; createHome = true;
openssh.authorizedKeys.keys = [pubkey]; openssh.authorizedKeys.keys = [pubkey];
group = username; group = username;
extraGroups = ["users" "wheel" "video" "dialout" "uucp" "kvm"]; extraGroups = ["users" "wheel" "video" "dialout" "uucp"];
packages = []; packages = [];
}; };
home-manager.users.daniel = { home-manager.users.daniel = {
@ -1218,51 +950,48 @@
root root
]; ];
# boot.tmp.useTmpfs = true; boot.tmp.useTmpfs = true;
systemd.services.nix-daemon = { systemd.services.nix-daemon = {
environment.TMPDIR = "/var/tmp"; environment.TMPDIR = "/var/tmp";
}; };
boot.tmp.cleanOnBoot = true; boot.tmp.cleanOnBoot = true;
# boot.uki.tries = 3; services.irqbalance.enable = true;
# services.irqbalance.enable = true;
# this is not ready for primetime yet services.kanidm = {
# services.kanidm = { enableClient = true;
# enableClient = true; enablePam = true;
# enablePam = true; package = pkgs.kanidm;
# package = pkgs.kanidm;
# clientSettings.uri = "https://idm.h.lyte.dev"; clientSettings.uri = "https://idm.h.lyte.dev";
# unixSettings = { unixSettings = {
# # hsm_pin_path = "/somewhere/else"; # hsm_pin_path = "/somewhere/else";
# pam_allowed_login_groups = []; pam_allowed_login_groups = [];
# }; };
# }; };
# systemd.tmpfiles.rules = [
# "d /etc/kanidm 1755 nobody users -" systemd.tmpfiles.rules = [
# ]; "d /etc/kanidm 1755 nobody users -"
];
# module has the incorrect file permissions out of the box # module has the incorrect file permissions out of the box
# environment.etc = { environment.etc = {
/* # "kanidm" = {
"kanidm" = { # enable = true;
enable = true;
user = "nobody";
group = "users";
mode = "0755";
};
*/
# "kanidm/unixd" = {
# user = "kanidm-unixd";
# group = "kanidm-unixd";
# mode = "0700";
# };
# "kanidm/config" = {
# user = "nobody"; # user = "nobody";
# group = "users"; # group = "users";
# mode = "0755"; # mode = "0755";
# }; # };
# }; "kanidm/unixd" = {
user = "kanidm-unixd";
group = "kanidm-unixd";
mode = "0700";
};
"kanidm/config" = {
user = "nobody";
group = "users";
mode = "0755";
};
};
programs.gnupg.agent = { programs.gnupg.agent = {
enable = true; enable = true;
@ -1270,7 +999,7 @@
}; };
time = { time = {
timeZone = "America/Chicago"; timeZone = lib.mkDefault "America/Chicago";
}; };
i18n = { i18n = {
@ -1293,7 +1022,7 @@
useXkbConfig = lib.mkDefault true; useXkbConfig = lib.mkDefault true;
earlySetup = lib.mkDefault true; earlySetup = lib.mkDefault true;
colors = with style.colors; [ colors = with colors; [
bg bg
red red
green green
@ -1321,6 +1050,7 @@
}; };
}; };
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
system.stateVersion = lib.mkDefault "24.05"; system.stateVersion = lib.mkDefault "24.05";
}; };

View file

@ -31,7 +31,7 @@ in {
requestTimeout = mkOption { requestTimeout = mkOption {
type = types.int; type = types.int;
description = "The maximum number of seconds before the HTTP request times out."; description = "The maximum number of seconds before the HTTP request times out.";
default = 180; default = 30;
}; };
afterBootTime = mkOption { afterBootTime = mkOption {
type = types.str; type = types.str;
@ -64,24 +64,18 @@ in {
set -eu set -eu
password="$(cat "${cfg.passwordFile}")" password="$(cat "${cfg.passwordFile}")"
${optionalString cfg.ipv4 '' ${optionalString cfg.ipv4 ''
"${pkgs.curl}/bin/curl" -4 -s \ ${pkgs.curl}/bin/curl -4 -s \
-vvv \
-X POST \ -X POST \
--max-time ${toString cfg.requestTimeout} \ --max-time ${toString cfg.requestTimeout} \
-u "${cfg.username}:''${password}" \ -u "${cfg.username}:''${password}" \
-L "${cfg.endpoint}/v1/netlify-ddns/replace-all-relevant-user-dns-records" 2>&1 \ -L "${cfg.endpoint}/v1/netlify-ddns/replace-all-relevant-user-dns-records"
| "${pkgs.sd}/bin/sd" --fixed-strings "''${password}" "[REDACTED]" \
| "${pkgs.sd}/bin/sd" -f i "Authorization: .*" "Authorization: [REST OF LINE REDACTED]"
''} ''}
${optionalString cfg.ipv6 '' ${optionalString cfg.ipv6 ''
${pkgs.curl}/bin/curl -6 -s \ ${pkgs.curl}/bin/curl -6 -s \
-vvv \
-X POST \ -X POST \
--max-time ${toString cfg.requestTimeout} \ --max-time ${toString cfg.requestTimeout} \
-u "${cfg.username}:''${password}" \ -u "${cfg.username}:''${password}" \
-L "${cfg.endpoint}/v1/netlify-ddns/replace-all-relevant-user-dns-records" 2>&1 \ -L "${cfg.endpoint}/v1/netlify-ddns/replace-all-relevant-user-dns-records"
| "${pkgs.sd}/bin/sd" --fixed-strings "''${password}" "[REDACTED]" \
| "${pkgs.sd}/bin/sd" -f i "Authorization: .*" "Authorization: [REST OF LINE REDACTED]"
''} ''}
''; '';
serviceConfig = { serviceConfig = {

3
modules/nixos/ewwbar.nix Normal file
View file

@ -0,0 +1,3 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [eww upower jq];
}

View file

@ -40,6 +40,7 @@
environment = { environment = {
variables = { variables = {
GTK_THEME = "Catppuccin-Mocha-Compact-Sapphire-Dark";
VISUAL = "hx"; VISUAL = "hx";
PAGER = "less"; PAGER = "less";
MANPAGER = "less"; MANPAGER = "less";
@ -49,35 +50,36 @@
gnome.gnome-power-manager gnome.gnome-power-manager
brightnessctl brightnessctl
feh feh
# gimp
grim grim
# inkscape
# krita
libinput libinput
libinput-gestures libinput-gestures
libnotify libnotify
# lutris
# nil
# nixpkgs-fmt
noto-fonts noto-fonts
pamixer pamixer
# pavucontrol
playerctl playerctl
# pulseaudio
pulsemixer pulsemixer
# rclone
# restic
slurp slurp
# steam
swaybg swaybg
swayidle swayidle
swaylock swaylock
# vlc
# vulkan-tools
waybar waybar
# weechat
# wine
wl-clipboard wl-clipboard
zathura zathura
/*
gimp
inkscape
krita
pavucontrol
pulseaudio
rclone
restic
steam
vlc
vulkan-tools
weechat
wine
*/
]; ];
}; };
} }

View file

@ -0,0 +1,17 @@
{
inputs,
pkgs,
...
}: {
imports = [
./ewwbar.nix
./pipewire.nix
{
programs.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
};
environment.systemPackages = with pkgs; [hyprpaper xwaylandvideobridge socat];
}
];
}

81
modules/nixos/sway.nix Normal file
View file

@ -0,0 +1,81 @@
{pkgs, ...}: {
imports = [
./pipewire.nix
];
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
# services.xserver.libinput.enable = true;
services.gnome.gnome-keyring.enable = true;
xdg.portal = {
enable = true;
wlr.enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
];
};
services.dbus.enable = true;
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [thunar-archive-plugin thunar-volman];
};
services.gvfs = {
enable = true;
};
environment = {
variables = {
GTK_THEME = "Catppuccin-Mocha-Compact-Sapphire-Dark";
VISUAL = "hx";
PAGER = "less";
MANPAGER = "less";
};
systemPackages = with pkgs; [
brightnessctl
feh
# gimp
grim
# inkscape
# krita
libinput
libinput-gestures
libnotify
# mako
# lutris
# nil
# nixpkgs-fmt
noto-fonts
pamixer
# pavucontrol
playerctl
pulseaudio
pulsemixer
# rclone
# restic
slurp
# steam
swaybg
swayidle
swaylock
swayosd
tofi
# vlc
# vulkan-tools
waybar
# weechat
# wine
wl-clipboard
zathura
];
};
}

File diff suppressed because it is too large Load diff

View file

@ -40,23 +40,21 @@
}; };
}; };
/* # networking = {
networking = { # firewall = let
firewall = let # terraria = 7777;
terraria = 7777; # stardew-valley = 24642;
stardew-valley = 24642; # web-dev-lan = 18888;
web-dev-lan = 18888; # ports = [
ports = [ # terraria
terraria # stardew-valley
stardew-valley # web-dev-lan
web-dev-lan # ];
]; # in {
in { # allowedTCPPorts = ports;
allowedTCPPorts = ports; # allowedUDPPorts = ports;
allowedUDPPorts = ports; # };
}; # };
};
*/
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
radeontop radeontop
@ -65,73 +63,69 @@
]; ];
home-manager.users.daniel = { home-manager.users.daniel = {
/* # slippi-launcher = {
slippi-launcher = { # enable = true;
enable = true; # # isoPath = "${config.home-manager.users.daniel.home.homeDirectory}/../games/roms/dolphin/melee.iso";
# isoPath = "${config.home-manager.users.daniel.home.homeDirectory}/../games/roms/dolphin/melee.iso"; # launchMeleeOnPlay = false;
launchMeleeOnPlay = false; # };
};
*/
# TODO: monitor config module? # TODO: monitor config module?
/* # wayland.windowManager.hyprland = {
wayland.windowManager.hyprland = { # settings = {
settings = { # env = [
env = [ # "EWW_BAR_MON,1"
"EWW_BAR_MON,1" # ];
]; # # See https://wiki.hyprland.org/Configuring/Keywords/ for more
# See https://wiki.hyprland.org/Configuring/Keywords/ for more # monitor = [
monitor = [ # # "DP-2,3840x2160@60,-2160x0,1,transform,3"
# "DP-2,3840x2160@60,-2160x0,1,transform,3" # "DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1"
"DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1" # # HDR breaks screenshare? "DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1,bitdepth,10"
## HDR breaks screenshare? "DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1,bitdepth,10" # # "desc:LG Display 0x0521,3840x2160@120,0x0,1"
## "desc:LG Display 0x0521,3840x2160@120,0x0,1" # # "desc:Dell Inc. DELL U2720Q D3TM623,3840x2160@60,3840x0,1.5,transform,1"
## "desc:Dell Inc. DELL U2720Q D3TM623,3840x2160@60,3840x0,1.5,transform,1" # "DP-2,3840x2160@60,0x0,1.5,transform,1"
"DP-2,3840x2160@60,0x0,1.5,transform,1" # ];
]; # input = {
input = { # force_no_accel = true;
force_no_accel = true; # sensitivity = 1; # -1.0 - 1.0, 0 means no modification.
sensitivity = 1; # -1.0 - 1.0, 0 means no modification. # };
}; # };
}; # };
};
wayland.windowManager.sway = { # wayland.windowManager.sway = {
config = { # config = {
output = { # output = {
"GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307" = { # "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307" = {
mode = "3840x2160@120Hz"; # mode = "3840x2160@120Hz";
position = "${toString (builtins.ceil (2160 / 1.5))},0"; # position = "${toString (builtins.ceil (2160 / 1.5))},0";
}; # };
"Dell Inc. DELL U2720Q D3TM623" = { # "Dell Inc. DELL U2720Q D3TM623" = {
# desktop left vertical monitor # # desktop left vertical monitor
mode = "3840x2160@60Hz"; # mode = "3840x2160@60Hz";
transform = "90"; # transform = "90";
scale = "1.5"; # scale = "1.5";
position = "0,0"; # position = "0,0";
}; # };
}; # };
workspaceOutputAssign = # workspaceOutputAssign =
( # (
map # map
(ws: { # (ws: {
output = "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307"; # output = "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307";
workspace = toString ws; # workspace = toString ws;
}) # })
(lib.range 1 7) # (lib.range 1 7)
) # )
++ ( # ++ (
map # map
(ws: { # (ws: {
output = "Dell Inc. DELL U2720Q D3TM623"; # output = "Dell Inc. DELL U2720Q D3TM623";
workspace = toString ws; # workspace = toString ws;
}) # })
(lib.range 8 9) # (lib.range 8 9)
); # );
}; # };
}; # };
*/
}; };
} }

View file

@ -6,39 +6,11 @@
}: { }: {
imports = [ imports = [
{ {
system.stateVersion = "24.11"; system.stateVersion = "24.05";
home-manager.users.daniel.home.stateVersion = "24.05"; home-manager.users.daniel.home.stateVersion = "24.05";
networking.hostName = "dragon"; networking.hostName = "dragon";
} }
{
# sops secrets config
sops = {
defaultSopsFile = ../secrets/dragon/secrets.yml;
age = {
sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
keyFile = "/var/lib/sops-nix/key.txt";
generateKey = true;
};
};
}
{
sops.secrets = {
ddns-pass = {mode = "0400";};
};
services.deno-netlify-ddns-client = {
passwordFile = config.sops.secrets.ddns-pass.path;
};
}
]; ];
hardware.amdgpu = {
amdvlk = {
enable = true;
support32Bit = {
enable = true;
};
};
};
hardware.graphics.extraPackages = [ hardware.graphics.extraPackages = [
# pkgs.rocmPackages.clr.icd # pkgs.rocmPackages.clr.icd
pkgs.amdvlk pkgs.amdvlk
@ -101,76 +73,62 @@
}; };
# TODO: monitor config module? # TODO: monitor config module?
wayland.windowManager.hyprland = { # wayland.windowManager.hyprland = {
settings = { # settings = {
exec-once = [ # env = [
"eww open bar1" # "EWW_BAR_MON,1"
]; # ];
# See https://wiki.hyprland.org/Configuring/Keywords/ for more # # See https://wiki.hyprland.org/Configuring/Keywords/ for more
monitor = [ # monitor = [
# "DP-2,3840x2160@60,-2160x0,1,transform,3" # # "DP-2,3840x2160@60,-2160x0,1,transform,3"
"DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1" # "DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1"
# TODO: HDR breaks screenshare? # # HDR breaks screenshare? "DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1,bitdepth,10"
/* # # "desc:LG Display 0x0521,3840x2160@120,0x0,1"
"DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1,bitdepth,10" # # "desc:Dell Inc. DELL U2720Q D3TM623,3840x2160@60,3840x0,1.5,transform,1"
"desc:LG Display 0x0521,3840x2160@120,0x0,1" # "DP-2,3840x2160@60,0x0,1.5,transform,1"
"desc:Dell Inc. DELL U2720Q D3TM623,3840x2160@60,3840x0,1.5,transform,1" # ];
*/ # input = {
"DP-1,3840x2160@60,0x0,1.5,transform,1" # force_no_accel = true;
]; # sensitivity = 1; # -1.0 - 1.0, 0 means no modification.
input = { # };
force_no_accel = true; # };
sensitivity = 1; # -1.0 - 1.0, 0 means no modification. # };
};
workspace = [
"1, monitor:DP-3, default:true"
"2, monitor:DP-3, default:false"
"3, monitor:DP-3, default:false"
"4, monitor:DP-3, default:false"
"5, monitor:DP-3, default:false"
"6, monitor:DP-3, default:false"
"7, monitor:DP-3, default:false"
"8, monitor:DP-1, default:true"
"9, monitor:DP-1, default:false"
];
};
};
wayland.windowManager.sway = { # wayland.windowManager.sway = {
config = { # config = {
output = { # output = {
"GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307" = { # "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307" = {
mode = "3840x2160@120Hz"; # mode = "3840x2160@120Hz";
position = "${toString (builtins.ceil (2160 / 1.5))},0"; # position = "${toString (builtins.ceil (2160 / 1.5))},0";
}; # };
"Dell Inc. DELL U2720Q D3TM623" = { # "Dell Inc. DELL U2720Q D3TM623" = {
# desktop left vertical monitor # # desktop left vertical monitor
mode = "3840x2160@60Hz"; # mode = "3840x2160@60Hz";
transform = "270"; # transform = "90";
scale = "1.5"; # scale = "1.5";
position = "0,0"; # position = "0,0";
}; # };
}; # };
workspaceOutputAssign = # workspaceOutputAssign =
( # (
map # map
(ws: { # (ws: {
output = "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307"; # output = "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307";
workspace = toString ws; # workspace = toString ws;
}) # })
(lib.range 1 7) # (lib.range 1 7)
) # )
++ ( # ++ (
map # map
(ws: { # (ws: {
output = "Dell Inc. DELL U2720Q D3TM623"; # output = "Dell Inc. DELL U2720Q D3TM623";
workspace = toString ws; # workspace = toString ws;
}) # })
(lib.range 8 9) # (lib.range 8 9)
); # );
}; # };
}; # };
}; };
} }

View file

@ -1,14 +0,0 @@
{
"x86_64-linux": {
"headless": {
"stable": {
"name": "factorio_headless_x64-2.0.15.tar.xz",
"needsAuth": false,
"sha256": "cLRBy4B4EaYFhsARBySMHY164EO9HyNnX8kk+6qlONg=",
"tarDirectory": "x64",
"url": "https://factorio.com/get-download/2.0.15/headless/linux64",
"version": "2.0.15"
}
}
}
}

View file

@ -1,244 +1,4 @@
{pkgs, ...}: {pkgs, ...}: {
/*
## source: https://community.frame.work/t/speakers-sound-quality/1078/82
let
pipewire-speakers-profile-json = ''{
"output": {
"blocklist": [],
"equalizer": {
"balance": 0.0,
"bypass": false,
"input-gain": 0.0,
"left": {
"band0": {
"frequency": 100.0,
"gain": 0.0,
"mode": "RLC (BT)",
"mute": false,
"q": 1.0,
"slope": "x4",
"solo": false,
"type": "Hi-pass"
},
"band1": {
"frequency": 150.0,
"gain": 4.02,
"mode": "RLC (BT)",
"mute": false,
"q": 3.0,
"slope": "x1",
"solo": false,
"type": "Bell"
},
"band2": {
"frequency": 600.0,
"gain": -5.07,
"mode": "RLC (BT)",
"mute": false,
"q": 4.000000000000008,
"slope": "x1",
"solo": false,
"type": "Bell"
},
"band3": {
"frequency": 1200.0,
"gain": -3.49,
"mode": "RLC (BT)",
"mute": false,
"q": 4.17,
"slope": "x1",
"solo": false,
"type": "Bell"
},
"band4": {
"frequency": 2000.0,
"gain": 1.43,
"mode": "RLC (BT)",
"mute": false,
"q": 4.0,
"slope": "x1",
"solo": false,
"type": "Bell"
},
"band5": {
"frequency": 5300.0,
"gain": 3.84,
"mode": "RLC (BT)",
"mute": false,
"q": 2.64,
"slope": "x1",
"solo": false,
"type": "Bell"
},
"band6": {
"frequency": 6000.0,
"gain": 4.02,
"mode": "RLC (BT)",
"mute": false,
"q": 4.36,
"slope": "x1",
"solo": false,
"type": "Hi-shelf"
},
"band7": {
"frequency": 7500.0,
"gain": -2.09,
"mode": "RLC (BT)",
"mute": false,
"q": 3.0,
"slope": "x1",
"solo": false,
"type": "Bell"
},
"band8": {
"frequency": 8000.0,
"gain": 2.01,
"mode": "RLC (BT)",
"mute": false,
"q": 4.36,
"slope": "x1",
"solo": false,
"type": "Bell"
},
"band9": {
"frequency": 900.0,
"gain": -4.12,
"mode": "RLC (BT)",
"mute": false,
"q": 5.909999999999967,
"slope": "x1",
"solo": false,
"type": "Bell"
}
},
"mode": "IIR",
"num-bands": 10,
"output-gain": -1.5,
"pitch-left": 0.0,
"pitch-right": 0.0,
"right": {
"band0": {
"frequency": 100.0,
"gain": 0.0,
"mode": "RLC (BT)",
"mute": false,
"q": 1.0,
"slope": "x4",
"solo": false,
"type": "Hi-pass"
},
"band1": {
"frequency": 150.0,
"gain": 4.02,
"mode": "RLC (BT)",
"mute": false,
"q": 3.0,
"slope": "x1",
"solo": false,
"type": "Bell"
},
"band2": {
"frequency": 600.0,
"gain": -5.07,
"mode": "RLC (BT)",
"mute": false,
"q": 4.000000000000008,
"slope": "x1",
"solo": false,
"type": "Bell"
},
"band3": {
"frequency": 1200.0,
"gain": -3.49,
"mode": "RLC (BT)",
"mute": false,
"q": 4.17,
"slope": "x1",
"solo": false,
"type": "Bell"
},
"band4": {
"frequency": 2000.0,
"gain": 1.43,
"mode": "RLC (BT)",
"mute": false,
"q": 4.0,
"slope": "x1",
"solo": false,
"type": "Bell"
},
"band5": {
"frequency": 5300.0,
"gain": 3.84,
"mode": "RLC (BT)",
"mute": false,
"q": 2.64,
"slope": "x1",
"solo": false,
"type": "Bell"
},
"band6": {
"frequency": 6000.0,
"gain": 4.02,
"mode": "RLC (BT)",
"mute": false,
"q": 4.36,
"slope": "x1",
"solo": false,
"type": "Hi-shelf"
},
"band7": {
"frequency": 7500.0,
"gain": -2.09,
"mode": "RLC (BT)",
"mute": false,
"q": 3.0,
"slope": "x1",
"solo": false,
"type": "Bell"
},
"band8": {
"frequency": 8000.0,
"gain": 2.01,
"mode": "RLC (BT)",
"mute": false,
"q": 4.36,
"slope": "x1",
"solo": false,
"type": "Bell"
},
"band9": {
"frequency": 900.0,
"gain": -4.12,
"mode": "RLC (BT)",
"mute": false,
"q": 5.909999999999967,
"slope": "x1",
"solo": false,
"type": "Bell"
}
},
"split-channels": false
},
"loudness": {
"bypass": false,
"clipping": false,
"clipping-range": 6.0,
"fft": "4096",
"input-gain": 0.0,
"output-gain": 0.0,
"std": "ISO226-2003",
"volume": 6.999999999999991
},
"plugins_order": [
"loudness",
"equalizer"
]
}
}'';
in
*/
{
imports = [ imports = [
{ {
system.stateVersion = "24.05"; system.stateVersion = "24.05";
@ -246,27 +6,37 @@ in
networking.hostName = "foxtrot"; networking.hostName = "foxtrot";
} }
{ {
# laptop power management
services.upower.enable = true;
swapDevices = [ swapDevices = [
# 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
*/
{device = "/swap/swapfile";} {device = "/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=30m";
services.fwupd.enable = true; services.fwupd.enable = true;
services.fwupd.extraRemotes = ["lvfs-testing"]; services.fwupd.extraRemotes = ["lvfs-testing"];
# NOTE: I'm letting plasma settings handle this I guess?
# services.logind = {
# lidSwitch = "suspend-then-hibernate";
# # HandleLidSwitchDocked=ignore
# extraConfig = ''
# HandlePowerKey=suspend-then-hibernate
# IdleActionSec=10m
# IdleAction=suspend-then-hibernate
# '';
# };
} }
]; ];
environment = { environment = {
systemPackages = with pkgs; [ systemPackages = with pkgs; [
easyeffects
godot_4 godot_4
fractal fractal
prismlauncher prismlauncher
@ -286,73 +56,37 @@ in
}; };
}; };
services.easyeffects = { # wayland.windowManager.hyprland = {
enable = true; # settings = {
preset = "philonmetal"; # env = [
# clone from https://github.com/ceiphr/ee-framework-presets # "EWW_BAR_MON,0"
# then `cp *.json ~/.config/easyeffects/output` # ];
# TODO: nixify this # # See https://wiki.hyprland.org/Configuring/Keywords/ for more
}; # monitor = [
# "eDP-1,2256x1504@60,0x0,${toString scale}"
# ];
# };
# };
services.hypridle = let # wayland.windowManager.sway = {
secondsPerMinute = 60; # config = {
lockSeconds = 10 * secondsPerMinute; # output = {
in { # "BOE 0x0BCA Unknown" = {
settings = { # mode = "2256x1504@60Hz";
listener = [ # position = "0,0";
{ # scale = toString scale;
timeout = lockSeconds + 55; # };
on-timeout = ''systemctl suspend'';
}
];
};
};
wayland.windowManager.hyprland = { # "Dell Inc. DELL U2720Q D3TM623" = {
settings = { # # desktop left vertical monitor
exec-once = [ # mode = "1920x1080@60Hz";
"eww open bar0" # # transform = "90";
]; # # scale = "1.5";
# See https://wiki.hyprland.org/Configuring/Keywords/ for more # position = "${toString (builtins.floor (2256 / scale))},0";
monitor = [ # };
"eDP-1,2880x1920@120Hz,0x0,1.66667" # };
]; # };
}; # };
};
wayland.windowManager.sway = {
config = {
output = {
"BOE NE135A1M-NY1 Unknown" = {
mode = "2880x1920@120Hz";
position = "1092,2160";
scale = toString (5 / 3);
};
"Dell Inc. DELL U2720Q CWTM623" = {
mode = "3840x2160@60Hz";
position = "0,0";
scale = toString 1.25;
};
/*
"BOE 0x0BCA Unknown" = {
mode = "2256x1504@60Hz";
position = "0,0";
scale = toString scale;
};
"Dell Inc. DELL U2720Q D3TM623" = {
# desktop left vertical monitor
mode = "1920x1080@60Hz";
# transform = "90";
# scale = "1.5";
position = "${toString (builtins.floor (2256 / scale))},0";
};
*/
};
};
};
}; };
hardware.graphics.extraPackages = [ hardware.graphics.extraPackages = [
@ -364,34 +98,24 @@ in
pkgs.vaapiVdpau pkgs.vaapiVdpau
]; ];
hardware.amdgpu = {
amdvlk = {
enable = true;
support32Bit = {
enable = true;
};
};
};
networking.networkmanager.wifi.powersave = false; networking.networkmanager.wifi.powersave = false;
hardware.wirelessRegulatoryDatabase = true;
hardware.framework.amd-7040.preventWakeOnAC = true; hardware.framework.amd-7040.preventWakeOnAC = true;
boot = { boot = {
# kernelPackages = pkgs.linuxPackages_latest; kernelPackages = pkgs.linuxPackages_latest;
# 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 = {
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
@ -399,12 +123,11 @@ in
}; };
# 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
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
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"
"amdgpu.sg_display=0" "amdgpu.sg_display=0"
@ -417,41 +140,28 @@ in
]; ];
initrd.availableKernelModules = ["xhci_pci" "nvme" "thunderbolt"]; initrd.availableKernelModules = ["xhci_pci" "nvme" "thunderbolt"];
kernelModules = ["kvm-amd"]; kernelModules = ["kvm-amd"];
extraModprobeConfig = ''
options cfg80211 ieee80211_regdom="US"
'';
}; };
hardware.bluetooth = { hardware.bluetooth = {
enable = true; enable = true;
# TODO: when resuming from hibernation, it would be nice if this would # TODO: when resuming from hibernation, it would be nice if this would
# 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 {
version = "5.78";
src = pkgs.fetchurl {
url = "mirror://kernel/linux/bluetooth/bluez-${version}.tar.xz";
sha256 = "sha256-gw/tGRXF03W43g9eb0X83qDcxf9f+z0x227Q8A1zxeM=";
};
patches = [];
buildInputs =
previousAttrs.buildInputs
++ [
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 = {
enable = true; enable = true;
}; };
services.fprintd = { services.fprintd = {
enable = false; enable = true;
package = pkgs.fprintd.overrideAttrs { package = pkgs.fprintd.overrideAttrs {
# Source: https://github.com/NixOS/nixpkgs/commit/87ca2dc071581aea0e691c730d6844f1beb07c9f # Source: https://github.com/NixOS/nixpkgs/commit/87ca2dc071581aea0e691c730d6844f1beb07c9f
mesonCheckFlags = [ mesonCheckFlags = [
@ -460,40 +170,36 @@ in
"fprintd:TestPamFprintd" "fprintd:TestPamFprintd"
]; ];
}; };
# tod.enable = true;
# tod.driver = pkgs.libfprint-2-tod1-goodix;
}; };
/* # 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 = let
stardewValley = 24642; stardewValley = 24642;
factorio = 34197;
in [ in [
8000 # dev stuff 8000 # dev stuff
factorio
stardewValley stardewValley
7777 7777
]; ];
networking.firewall.allowedUDPPorts = let networking.firewall.allowedUDPPorts = let
stardewValley = 24642; stardewValley = 24642;
factorio = 34197;
in [ in [
8000 # dev stuff 8000 # dev stuff
factorio
stardewValley stardewValley
7777 7777
]; ];

View file

@ -1,5 +1,4 @@
{ {
pkgs,
config, config,
lib, lib,
... ...

View file

@ -58,19 +58,15 @@
hardware.raspberry-pi."4".audio.enable = true; hardware.raspberry-pi."4".audio.enable = true;
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
systemd.targets.sleep.enable = false; systemd.targets.sleep.enable = false;
@ -103,40 +99,38 @@
}; };
}; };
/* # 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

@ -25,14 +25,11 @@
device = "/dev/sda"; device = "/dev/sda";
}; };
users.groups.beefcake = {};
users.users = { users.users = {
beefcake = { beefcake = {
isSystemUser = true; # used for restic backups
createHome = true; # TODO: can this be a system user?
home = "/storage/backups/beefcake"; isNormalUser = true;
group = "beefcake";
extraGroups = ["sftponly"];
openssh.authorizedKeys.keys = openssh.authorizedKeys.keys =
config.users.users.daniel.openssh.authorizedKeys.keys config.users.users.daniel.openssh.authorizedKeys.keys
++ [ ++ [
@ -55,13 +52,6 @@
}; };
}; };
services.openssh.extraConfig = ''
Match Group sftponly
ChrootDirectory /storage/backups/%u
ForceCommand internal-sftp
AllowTcpForwarding no
'';
networking = { networking = {
hostName = "rascal"; hostName = "rascal";
networkmanager.enable = true; networkmanager.enable = true;

View file

@ -1,19 +1,17 @@
{ {
config,
lib, lib,
# outputs, # outputs,
# config,
pkgs, pkgs,
... ...
}: let }: let
/* # NOTE: My goal is to be able to apply most of the common tweaks to the router
NOTE: My goal is to be able to apply most of the common tweaks to the router # either live on the system for ad-hoc changes (such as forwarding a port for a
either live on the system for ad-hoc changes (such as forwarding a port for a # multiplayer game) or to tweak these values just below without reaching deeper
multiplayer game) or to tweak these values just below without reaching deeper # into the modules' implementation of these configuration values
into the modules' implementation of these configuration values # NOTE: I could turn this into a cool NixOS module?
NOTE: I could turn this into a cool NixOS module? # TODO: review https://francis.begyn.be/blog/nixos-home-router
TODO: review https://francis.begyn.be/blog/nixos-home-router # TODO: more recent: https://github.com/ghostbuster91/blogposts/blob/a2374f0039f8cdf4faddeaaa0347661ffc2ec7cf/router2023-part2/main.md
TODO: more recent: https://github.com/ghostbuster91/blogposts/blob/a2374f0039f8cdf4faddeaaa0347661ffc2ec7cf/router2023-part2/main.md
*/
hostname = "router"; hostname = "router";
domain = "h.lyte.dev"; domain = "h.lyte.dev";
ip = "192.168.0.1"; ip = "192.168.0.1";
@ -51,18 +49,12 @@
"idm.h.lyte.dev" "idm.h.lyte.dev"
"git.lyte.dev" "git.lyte.dev"
"video.lyte.dev" "video.lyte.dev"
"paperless.h.lyte.dev"
"audio.lyte.dev" "audio.lyte.dev"
"a.lyte.dev" "a.lyte.dev"
"bw.lyte.dev" "bw.lyte.dev"
"files.lyte.dev" "files.lyte.dev"
"vpn.h.lyte.dev" "vpn.h.lyte.dev"
"atuin.h.lyte.dev" "atuin.h.lyte.dev"
"grafana.h.lyte.dev"
"prometheus.h.lyte.dev"
"finances.h.lyte.dev"
"nextcloud.h.lyte.dev"
"onlyoffice.h.lyte.dev"
"a.lyte.dev" "a.lyte.dev"
]; ];
}; };
@ -104,25 +96,6 @@ in {
} }
]; ];
environment.systemPackages = with pkgs; [
iftop
];
sops = {
defaultSopsFile = ../secrets/router/secrets.yml;
age = {
sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
keyFile = "/var/lib/sops-nix/key.txt";
generateKey = true;
};
secrets = {
netlify-ddns-password = {mode = "0400";};
};
};
services.deno-netlify-ddns-client = {
passwordFile = config.sops.secrets.netlify-ddns-password.path;
};
boot.kernel.sysctl = boot.kernel.sysctl =
sysctl-entries sysctl-entries
// { // {
@ -164,22 +137,22 @@ in {
checkRuleset = true; checkRuleset = true;
ruleset = with inf; '' ruleset = with inf; ''
table inet filter { table inet filter {
## set LANv4 { # set LANv4 {
## type ipv4_addr # type ipv4_addr
## flags interval # flags interval
## elements = { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 } # elements = { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 }
## } # }
## set LANv6 { # set LANv6 {
## type ipv6_addr # type ipv6_addr
## flags interval # flags interval
## elements = { fd00::/8, fe80::/10 } # elements = { fd00::/8, fe80::/10 }
## } # }
## TODO: maybe tailnet? # TODO: maybe tailnet?
## chain my_input_lan { # chain my_input_lan {
## udp sport 1900 udp dport >= 1024 meta pkttype unicast limit rate 4/second burst 20 packets accept comment "Accept UPnP IGD port mapping reply" # udp sport 1900 udp dport >= 1024 meta pkttype unicast limit rate 4/second burst 20 packets accept comment "Accept UPnP IGD port mapping reply"
## udp sport netbios-ns udp dport >= 1024 meta pkttype unicast accept comment "Accept Samba Workgroup browsing replies" # udp sport netbios-ns udp dport >= 1024 meta pkttype unicast accept comment "Accept Samba Workgroup browsing replies"
## } # }
chain input { chain input {
type filter hook input priority 0; policy drop; type filter hook input priority 0; policy drop;
@ -214,13 +187,12 @@ in {
udp dport { 80, 443 } accept comment "Allow QUIC to server (see nat prerouting)" udp dport { 80, 443 } accept comment "Allow QUIC to server (see nat prerouting)"
tcp dport { 22 } accept comment "Allow SSH to server (see nat prerouting)" tcp dport { 22 } accept comment "Allow SSH to server (see nat prerouting)"
tcp dport { 25565 } accept comment "Allow Minecraft server connections (see nat prerouting)" tcp dport { 25565 } accept comment "Allow Minecraft server connections (see nat prerouting)"
udp dport { 34197 } accept comment "Allow Factorio server connections (see nat prerouting)"
iifname "${lan}" accept comment "Allow local network to access the router" iifname "${lan}" accept comment "Allow local network to access the router"
iifname "tailscale0" accept comment "Allow local network to access the router" iifname "tailscale0" accept comment "Allow local network to access the router"
## ip6 saddr @LANv6 jump my_input_lan comment "Connections from private IP address ranges" # ip6 saddr @LANv6 jump my_input_lan comment "Connections from private IP address ranges"
## ip saddr @LANv4 jump my_input_lan comment "Connections from private IP address ranges" # ip saddr @LANv4 jump my_input_lan comment "Connections from private IP address ranges"
iifname "${wan}" counter drop comment "Drop all other unsolicited traffic from wan" iifname "${wan}" counter drop comment "Drop all other unsolicited traffic from wan"
} }
@ -235,13 +207,13 @@ in {
accept accept
} }
## chain forward { # chain forward {
## type filter hook forward priority filter; policy drop; # type filter hook forward priority filter; policy drop;
## iifname { "${lan}" } oifname { "${wan}" } accept comment "Allow trusted LAN to WAN" # iifname { "${lan}" } oifname { "${wan}" } accept comment "Allow trusted LAN to WAN"
## iifname { "tailscale0" } oifname { "${wan}" } accept comment "Allow trusted LAN to WAN" # iifname { "tailscale0" } oifname { "${wan}" } accept comment "Allow trusted LAN to WAN"
## iifname { "${wan}" } oifname { "${lan}" } ct state { established, related } accept comment "Allow established back to LAN" # iifname { "${wan}" } oifname { "${lan}" } ct state { established, related } accept comment "Allow established back to LAN"
## } # }
} }
table ip nat { table ip nat {
@ -257,7 +229,6 @@ in {
iifname ${wan} tcp dport {26966} dnat to ${hosts.beefcake.ip} iifname ${wan} tcp dport {26966} dnat to ${hosts.beefcake.ip}
iifname ${wan} tcp dport {25565} dnat to ${hosts.bald.ip} iifname ${wan} tcp dport {25565} dnat to ${hosts.bald.ip}
iifname ${wan} udp dport {25565} dnat to ${hosts.bald.ip} iifname ${wan} udp dport {25565} dnat to ${hosts.bald.ip}
iifname ${wan} udp dport {34197} dnat to ${hosts.beefcake.ip}
} }
chain postrouting { chain postrouting {
@ -269,58 +240,56 @@ in {
}; };
# NOTE: see flake.nix 'nnf.nixosModules.default' # NOTE: see flake.nix 'nnf.nixosModules.default'
/* # nftables.firewall = let
nftables.firewall = let # me = config.networking.nftables.firewall.localZoneName;
me = config.networking.nftables.firewall.localZoneName; # in {
in { # enable = true;
enable = true; # snippets.nnf-common.enable = true;
snippets.nnf-common.enable = true;
zones = { # zones = {
${interfaces.wan.name} = { # ${interfaces.wan.name} = {
interfaces = [interfaces.wan.name interfaces.lan.name]; # interfaces = [interfaces.wan.name interfaces.lan.name];
}; # };
${interfaces.lan.name} = { # ${interfaces.lan.name} = {
parent = interfaces.wan.name; # parent = interfaces.wan.name;
ipv4Addresses = [cidr]; # ipv4Addresses = [cidr];
}; # };
## banned = { # # banned = {
## ingressExpression = [ # # ingressExpression = [
## "ip saddr @banlist" # # "ip saddr @banlist"
## "ip6 saddr @banlist6" # # "ip6 saddr @banlist6"
## ]; # # ];
## egressExpression = [ # # egressExpression = [
## "ip daddr @banlist" # # "ip daddr @banlist"
## "ip6 daddr @banlist6" # # "ip6 daddr @banlist6"
## ]; # # ];
## }; # # };
}; # };
rules = { # rules = {
dhcp = { # dhcp = {
from = "all"; # from = "all";
to = [hosts.beefcake.ip]; # to = [hosts.beefcake.ip];
allowedTCPPorts = [67]; # allowedTCPPorts = [67];
allowedUDPPorts = [67]; # allowedUDPPorts = [67];
}; # };
http = { # http = {
from = "all"; # from = "all";
to = [me]; # to = [me];
allowedTCPPorts = [80 443]; # allowedTCPPorts = [80 443];
}; # };
router-ssh = { # router-ssh = {
from = "all"; # from = "all";
to = [me]; # to = [me];
allowedTCPPorts = [2201]; # allowedTCPPorts = [2201];
}; # };
server-ssh = { # server-ssh = {
from = "all"; # from = "all";
to = [hosts.beefcake.ip]; # to = [hosts.beefcake.ip];
allowedTCPPorts = [22]; # allowedTCPPorts = [22];
}; # };
}; # };
}; # };
*/
}; };
systemd.network = { systemd.network = {
@ -368,35 +337,29 @@ in {
ConfigureWithoutCarrier = true; ConfigureWithoutCarrier = true;
# IPv6AcceptRA = false; # IPv6AcceptRA = false;
IPv6SendRA = true; IPv6SendRA = true;
DHCPPrefixDelegation = true; DHCPv6PrefixDelegation = true;
}; };
}; };
/* # WAN configuration requires DHCP to get addresses
WAN configuration requires DHCP to get addresses # we also disable some options to be certain we retain as much networking
we also disable some options to be certain we retain as much networking # control as we reasonably can, such as not letting the ISP determine our
control as we reasonably can, such as not letting the ISP determine our # hostname or DNS configuration
hostname or DNS configuration # TODO: IPv6 (prefix delegation)
TODO: IPv6 (prefix delegation)
*/
"40-${interfaces.wan.name}" = { "40-${interfaces.wan.name}" = {
matchConfig.Name = "${interfaces.wan.name}"; matchConfig.Name = "${interfaces.wan.name}";
networkConfig = { networkConfig = {
Description = "WAN network - connection to fiber ISP jack"; Description = "WAN network - connection to fiber ISP jack";
DHCP = true; DHCP = true;
/* # IPv6AcceptRA = true;
IPv6AcceptRA = true; # IPv6PrivacyExtensions = true;
IPv6PrivacyExtensions = true; # IPForward = true;
IPForward = true;
*/
}; };
dhcpV6Config = { dhcpV6Config = {
/* # ForceDHCPv6PDOtherInformation = true;
ForceDHCPv6PDOtherInformation = true; # UseHostname = false;
UseHostname = false; # UseDNS = false;
UseDNS = false; # UseNTP = false;
UseNTP = false;
*/
PrefixDelegationHint = "::/56"; PrefixDelegationHint = "::/56";
}; };
dhcpV4Config = { dhcpV4Config = {
@ -422,21 +385,17 @@ in {
services.resolved.enable = false; services.resolved.enable = false;
/* # dnsmasq serves as our DHCP and DNS server
dnsmasq serves as our DHCP and DNS server # almost all the configuration should be derived from the values at the top of
almost all the configuration should be derived from the values at the top of # this file
this file
*/
services.dnsmasq = { services.dnsmasq = {
enable = true; enable = true;
settings = { settings = {
listen-address = "::,127.0.0.1,${ip}"; listen-address = "::,127.0.0.1,${ip}";
port = 53; port = 53;
/* # dhcp-authoritative = true;
dhcp-authoritative = true; # dnssec = true;
dnssec = true;
*/
enable-ra = true; enable-ra = true;
server = ["1.1.1.1" "9.9.9.9" "8.8.8.8"]; server = ["1.1.1.1" "9.9.9.9" "8.8.8.8"];
@ -489,10 +448,8 @@ in {
}; };
}; };
/* # since the home network reserves port 22 for ssh to the big server and to
since the home network reserves port 22 for ssh to the big server and to # gitea, the router uses port 2201 for ssh
gitea, the router uses port 2201 for ssh
*/
services.openssh.listenAddresses = [ services.openssh.listenAddresses = [
{ {
addr = "0.0.0.0"; addr = "0.0.0.0";
@ -516,254 +473,252 @@ in {
system.stateVersion = "24.05"; system.stateVersion = "24.05";
/* # NOTE: everything from here on is deprecated or old stuff
NOTE: everything from here on is deprecated or old stuff
TODO: may not be strictly necessary for IPv6? # TODO: may not be strictly necessary for IPv6?
TODO: also may not even be the best implementation? # TODO: also may not even be the best implementation?
services.radvd = { # services.radvd = {
enable = false; # enable = false;
## NOTE: this config is just the default arch linux config I think and may # # NOTE: this config is just the default arch linux config I think and may
## need tweaking? this is what I had on the arch linux router, though :shrug: # # need tweaking? this is what I had on the arch linux router, though :shrug:
config = '' # config = ''
interface lo # interface lo
{ # {
AdvSendAdvert on; # AdvSendAdvert on;
MinRtrAdvInterval 3; # MinRtrAdvInterval 3;
MaxRtrAdvInterval 10; # MaxRtrAdvInterval 10;
AdvDefaultPreference low; # AdvDefaultPreference low;
AdvHomeAgentFlag off; # AdvHomeAgentFlag off;
prefix 2001:db8:1:0::/64 # prefix 2001:db8:1:0::/64
{ # {
AdvOnLink on; # AdvOnLink on;
AdvAutonomous on; # AdvAutonomous on;
AdvRouterAddr off; # AdvRouterAddr off;
}; # };
prefix 0:0:0:1234::/64 # prefix 0:0:0:1234::/64
{ # {
AdvOnLink on; # AdvOnLink on;
AdvAutonomous on; # AdvAutonomous on;
AdvRouterAddr off; # AdvRouterAddr off;
Base6to4Interface ppp0; # Base6to4Interface ppp0;
AdvPreferredLifetime 120; # AdvPreferredLifetime 120;
AdvValidLifetime 300; # AdvValidLifetime 300;
}; # };
route 2001:db0:fff::/48 # route 2001:db0:fff::/48
{ # {
AdvRoutePreference high; # AdvRoutePreference high;
AdvRouteLifetime 3600; # AdvRouteLifetime 3600;
}; # };
RDNSS 2001:db8::1 2001:db8::2 # RDNSS 2001:db8::1 2001:db8::2
{ # {
AdvRDNSSLifetime 30; # AdvRDNSSLifetime 30;
}; # };
DNSSL branch.example.com example.com # DNSSL branch.example.com example.com
{ # {
AdvDNSSLLifetime 30; # AdvDNSSLLifetime 30;
}; # };
}; # };
''; # '';
}; # };
TODO: old config, should be deleted ASAP # TODO: old config, should be deleted ASAP
services.dnsmasq = { # services.dnsmasq = {
enable = false; # enable = false;
settings = { # settings = {
# server endpoints # # server endpoints
listen-address = "::1,127.0.0.1,${ip}"; # listen-address = "::1,127.0.0.1,${ip}";
port = "53"; # port = "53";
# DNS cache entries # # DNS cache entries
cache-size = "10000"; # cache-size = "10000";
# local domain entries # # local domain entries
local = "/lan/"; # local = "/lan/";
domain = "lan"; # domain = "lan";
expand-hosts = true; # expand-hosts = true;
dhcp-authoritative = true; # dhcp-authoritative = true;
conf-file = "/usr/share/dnsmasq/trust-anchors.conf"; # conf-file = "/usr/share/dnsmasq/trust-anchors.conf";
dnssec = true; # dnssec = true;
except-interface = "${wan_if}"; # except-interface = "${wan_if}";
interface = "${lan_if}"; # interface = "${lan_if}";
enable-ra = true; # enable-ra = true;
# dhcp-option = "121,${cidr},${ip}"; # # dhcp-option = "121,${cidr},${ip}";
dhcp-range = [ # dhcp-range = [
"lan,${dhcp_lease_space.min},${dhcp_lease_space.max},${netmask},10m" # "lan,${dhcp_lease_space.min},${dhcp_lease_space.max},${netmask},10m"
"tag:${lan_if},::1,constructor:${lan_if},ra-names,12h" # "tag:${lan_if},::1,constructor:${lan_if},ra-names,12h"
]; # ];
dhcp-host = [ # dhcp-host = [
"${hosts.dragon.host},${hosts.dragon.ip},12h" # "${hosts.dragon.host},${hosts.dragon.ip},12h"
"${hosts.beefcake.host},${hosts.beefcake.ip},12h" # "${hosts.beefcake.host},${hosts.beefcake.ip},12h"
]; # ];
# may need to go in /etc/hosts (networking.extraHosts), too? # # may need to go in /etc/hosts (networking.extraHosts), too?
address = [ # address = [
"/video.lyte.dev/192.168.0.9" # "/video.lyte.dev/192.168.0.9"
"/git.lyte.dev/192.168.0.9" # "/git.lyte.dev/192.168.0.9"
"/bw.lyte.dev/192.168.0.9" # "/bw.lyte.dev/192.168.0.9"
"/files.lyte.dev/192.168.0.9" # "/files.lyte.dev/192.168.0.9"
"/vpn.h.lyte.dev/192.168.0.9" # "/vpn.h.lyte.dev/192.168.0.9"
"/.h.lyte.dev/192.168.0.9" # "/.h.lyte.dev/192.168.0.9"
]; # ];
server = [ # server = [
"${ip}" # "${ip}"
"8.8.8.8" # "8.8.8.8"
"8.8.4.4" # "8.8.4.4"
"1.1.1.1" # "1.1.1.1"
"1.0.0.1" # "1.0.0.1"
]; # ];
}; # };
}; # };
TODO: old config, should be deleted ASAP # TODO: old config, should be deleted ASAP
nftables = { # nftables = {
enable = false; # enable = false;
flushRuleset = true; # flushRuleset = true;
tables = { # tables = {
filter = { # filter = {
family = "inet"; # family = "inet";
content = '' # content = ''
chain input { # chain input {
# type filter hook input priority filter; policy accept; # # type filter hook input priority filter; policy accept;
type filter hook input priority 0; # type filter hook input priority 0;
# anything from loopback interface # # anything from loopback interface
iifname "lo" accept # iifname "lo" accept
# accept traffic we originated # # accept traffic we originated
ct state { established, related } counter accept # ct state { established, related } counter accept
ct state invalid counter drop # ct state invalid counter drop
# ICMP # # ICMP
ip6 nexthdr icmpv6 icmpv6 type { echo-request, nd-neighbor-solicit, nd-neighbor-advert, nd-router-solicit, nd-router-advert, mld-listener-query, destination-unreachable, packet-too-big, time-exceeded, parameter-problem } counter accept # ip6 nexthdr icmpv6 icmpv6 type { echo-request, nd-neighbor-solicit, nd-neighbor-advert, nd-router-solicit, nd-router-advert, mld-listener-query, destination-unreachable, packet-too-big, time-exceeded, parameter-problem } counter accept
ip protocol icmp icmp type { echo-request, destination-unreachable, router-advertisement, time-exceeded, parameter-problem } counter accept # ip protocol icmp icmp type { echo-request, destination-unreachable, router-advertisement, time-exceeded, parameter-problem } counter accept
ip protocol icmpv6 counter accept # ip protocol icmpv6 counter accept
ip protocol icmp counter accept # ip protocol icmp counter accept
meta l4proto ipv6-icmp counter accept # meta l4proto ipv6-icmp counter accept
udp dport dhcpv6-client counter accept # udp dport dhcpv6-client counter accept
tcp dport { 64022, 22, 53, 67, 25565 } counter accept # tcp dport { 64022, 22, 53, 67, 25565 } counter accept
udp dport { 64020, 22, 53, 67 } counter accept # udp dport { 64020, 22, 53, 67 } counter accept
## iifname "iot" ip saddr $iot-ip tcp dport { llmnr } counter accept # # iifname "iot" ip saddr $iot-ip tcp dport { llmnr } counter accept
## iifname "iot" ip saddr $iot-ip udp dport { mdns, llmnr } counter accept # # iifname "iot" ip saddr $iot-ip udp dport { mdns, llmnr } counter accept
iifname "${lan_if}" tcp dport { llmnr } counter accept # iifname "${lan_if}" tcp dport { llmnr } counter accept
iifname "${lan_if}" udp dport { mdns, llmnr } counter accept # iifname "${lan_if}" udp dport { mdns, llmnr } counter accept
counter drop # counter drop
} # }
# allow all outgoing # # allow all outgoing
chain output { # chain output {
type filter hook output priority 0; # type filter hook output priority 0;
accept # accept
} # }
chain forward { # chain forward {
type filter hook forward priority 0; # type filter hook forward priority 0;
accept # accept
} # }
''; # '';
}; # };
nat = { # nat = {
family = "ip"; # family = "ip";
content = '' # content = ''
set masq_saddr { # set masq_saddr {
type ipv4_addr # type ipv4_addr
flags interval # flags interval
elements = { ${cidr} } # elements = { ${cidr} }
} # }
map map_port_ipport { # map map_port_ipport {
type inet_proto . inet_service : ipv4_addr . inet_service # type inet_proto . inet_service : ipv4_addr . inet_service
} # }
chain prerouting { # chain prerouting {
iifname ${lan_if} accept # iifname ${lan_if} accept
type nat hook prerouting priority dstnat + 1; policy accept; # type nat hook prerouting priority dstnat + 1; policy accept;
fib daddr type local dnat ip addr . port to meta l4proto . th dport map @map_port_ipport # fib daddr type local dnat ip addr . port to meta l4proto . th dport map @map_port_ipport
iifname ${wan_if} tcp dport { 22, 80, 443, 25565, 64022 } dnat to ${hosts.beefcake.ip} # iifname ${wan_if} tcp dport { 22, 80, 443, 25565, 64022 } dnat to ${hosts.beefcake.ip}
iifname ${wan_if} udp dport { 64020 } dnat to ${hosts.beefcake.ip} # iifname ${wan_if} udp dport { 64020 } dnat to ${hosts.beefcake.ip}
## iifname ${wan_if} tcp dport { 25565 } dnat to 192.168.0.244 # # iifname ${wan_if} tcp dport { 25565 } dnat to 192.168.0.244
## iifname ${wan_if} udp dport { 25565 } dnat to 192.168.0.244 # # iifname ${wan_if} udp dport { 25565 } dnat to 192.168.0.244
## router # # router
iifname ${wan_if} tcp dport { 2201 } dnat to ${ip} # iifname ${wan_if} tcp dport { 2201 } dnat to ${ip}
} # }
chain output { # chain output {
type nat hook output priority -99; policy accept; # type nat hook output priority -99; policy accept;
ip daddr != 127.0.0.0/8 oif "lo" dnat ip addr . port to meta l4proto . th dport map @map_port_ipport # ip daddr != 127.0.0.0/8 oif "lo" dnat ip addr . port to meta l4proto . th dport map @map_port_ipport
} # }
chain postrouting { # chain postrouting {
type nat hook postrouting priority srcnat + 1; policy accept; # type nat hook postrouting priority srcnat + 1; policy accept;
oifname ${lan_if} masquerade # oifname ${lan_if} masquerade
ip saddr @masq_saddr masquerade # ip saddr @masq_saddr masquerade
} # }
''; # '';
}; # };
}; # };
}; # };
TODO: also want to try to avoid using dhcpcd for IPv6 since systemd-networkd # TODO: also want to try to avoid using dhcpcd for IPv6 since systemd-networkd
should be sufficient? # should be sufficient?
dhcpcd = { # dhcpcd = {
enable = false; # enable = false;
extraConfig = '' # extraConfig = ''
duid # duid
## No way.... https://github.com/NetworkConfiguration/dhcpcd/issues/36#issuecomment-954777644 # # No way.... https://github.com/NetworkConfiguration/dhcpcd/issues/36#issuecomment-954777644
## issues caused by guests with oneplus devices # # issues caused by guests with oneplus devices
noarp # noarp
persistent # persistent
vendorclassid # vendorclassid
option domain_name_servers, domain_name, domain_search # option domain_name_servers, domain_name, domain_search
option classless_static_routes # option classless_static_routes
option interface_mtu # option interface_mtu
option host_name # option host_name
#option ntp_servers # #option ntp_servers
require dhcp_server_identifier # require dhcp_server_identifier
slaac private # slaac private
noipv4ll # noipv4ll
noipv6rs # noipv6rs
static domain_name_servers=${ip} # static domain_name_servers=${ip}
interface ${wan_if} # interface ${wan_if}
gateway # gateway
ipv6rs # ipv6rs
iaid 1 # iaid 1
## option rapid_commit # # option rapid_commit
## ia_na 1 # # ia_na 1
ia_pd 1 ${lan_if} # ia_pd 1 ${lan_if}
interface ${lan_if} # interface ${lan_if}
static ip_address=${cidr} # static ip_address=${cidr}
static routers=${ip} # static routers=${ip}
static domain_name_servers=${ip} # static domain_name_servers=${ip}
''; # '';
}; # };
*/
} }

View file

@ -1,11 +1,13 @@
{ {
pkgs,
lib, lib,
config, config,
... ...
}: { }: {
networking.hostName = "thablet"; networking.hostName = "thablet";
home-manager.users.daniel = {
};
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
services.fprintd = { services.fprintd = {
@ -42,26 +44,11 @@
boot.kernelModules = ["kvm-intel" "acpi_call"]; boot.kernelModules = ["kvm-intel" "acpi_call"];
boot.extraModulePackages = with config.boot.kernelPackages; [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;
graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [
intel-media-driver
intel-ocl
intel-vaapi-driver
];
};
};
hardware.bluetooth = { hardware.bluetooth = {
enable = true; enable = true;
powerOnBoot = false; powerOnBoot = true;
};
services.power-profiles-daemon = {
enable = true;
}; };
networking = { networking = {
@ -74,19 +61,5 @@
}; };
}; };
home-manager.users.daniel = {
wayland.windowManager.sway = {
config = {
output = {
"AU Optronics 0x2236 Unknown" = {
mode = "2560x1440@60Hz";
position = "0,0";
scale = toString 1.25;
};
};
};
};
};
system.stateVersion = "24.05"; system.stateVersion = "24.05";
} }

View file

@ -6,12 +6,10 @@
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
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"];
}; };

View file

@ -5,28 +5,22 @@
pkgs = import nixpkgs {inherit (final) system;}; pkgs = import nixpkgs {inherit (final) system;};
}; };
/* # This one contains whatever you want to overlay
This one contains whatever you want to overlay # You can change versions, add patches, set compilation flags, anything really.
You can change versions, add patches, set compilation flags, anything really. # https://nixos.wiki/wiki/Overlays
https://nixos.wiki/wiki/Overlays
*/
modifications = final: prev: { modifications = final: prev: {
/* # final.fprintd = prev.fprintd.overrideAttrs {
final.fprintd = prev.fprintd.overrideAttrs { # # Source: https://github.com/NixOS/nixpkgs/commit/87ca2dc071581aea0e691c730d6844f1beb07c9f
# Source: https://github.com/NixOS/nixpkgs/commit/87ca2dc071581aea0e691c730d6844f1beb07c9f # mesonCheckFlags = [
mesonCheckFlags = [ # # PAM related checks are timing out
# PAM related checks are timing out # "--no-suite"
"--no-suite" # "fprintd:TestPamFprintd"
"fprintd:TestPamFprintd" # ];
]; # };
};
*/
}; };
/* # When applied, the unstable nixpkgs set (declared in the flake inputs) will
When applied, the unstable nixpkgs set (declared in the flake inputs) will # be accessible through 'pkgs.unstable'
be accessible through 'pkgs.unstable'
*/
unstable-packages = final: _prev: { unstable-packages = final: _prev: {
unstable = import nixpkgs { unstable = import nixpkgs {
system = final.system; system = final.system;

View file

@ -34,10 +34,10 @@ in ((iosevka.override {
menu = 900 menu = 900
css = 900 css = 900
## [[buildPlans.Iosevka${set}.compatibility-ligatures]] # [[buildPlans.Iosevka${set}.compatibility-ligatures]]
## unicode = 57600 # 0xE100 # unicode = 57600 # 0xE100
## featureTag = 'calt' # featureTag = 'calt'
## kequence = '<*>' # kequence = '<*>'
[buildPlans.Iosevka${set}.variants] [buildPlans.Iosevka${set}.variants]
inherits = "ss01" inherits = "ss01"

View file

@ -1,15 +1,8 @@
<div align="center"> # Nix
<h1>
<img width="100" src="images/Nix_snowflake_lytedev.svg" /> <br>
Nix for <code>lytedev</code>
</h1>
[![flake check status](https://git.lyte.dev/lytedev/nix/badges/workflows/nix-flake-check.yaml/badge.svg)](https://git.lyte.dev/lytedev/nix/actions?workflow=nix-flake-check.yaml) [![flake check status](https://git.lyte.dev/lytedev/nix/badges/workflows/nix-flake-check.yaml/badge.svg)](https://git.lyte.dev/lytedev/nix/actions?workflow=nix-flake-check.yaml)
[![build status](https://git.lyte.dev/lytedev/nix/badges/workflows/nix-build.yaml/badge.svg)](https://git.lyte.dev/lytedev/nix/actions?workflow=nix-build.yaml) [![build status](https://git.lyte.dev/lytedev/nix/badges/workflows/nix-build.yaml/badge.svg)](https://git.lyte.dev/lytedev/nix/actions?workflow=nix-build.yaml)
</div>
My grand, declarative, and unified application, service, environment, and My grand, declarative, and unified application, service, environment, and
machine configuration, secret, and package management in a single flake. ❤️ ❄️ machine configuration, secret, and package management in a single flake. ❤️ ❄️

View file

@ -15,9 +15,7 @@ plausible-admin-password: ENC[AES256_GCM,data:dC9olypZgMLdPOsmjthOaa/fMLtbGBlF9A
plausible-erlang-cookie: ENC[AES256_GCM,data:zhmC+D6EjIE8Rw91lIrMqY0QIazTX1e1jBzcZJP/76B9VvHWZ5bCkP1+KdfCY0lk3wIEq5vRfb8=,iv:RNNjlV3OFtXn1N0a5fEb/3FWzcHX19wtCLMdaVlKNJ0=,tag:8iU5oFVbzd0eMe5Mo1PiAw==,type:str] plausible-erlang-cookie: ENC[AES256_GCM,data:zhmC+D6EjIE8Rw91lIrMqY0QIazTX1e1jBzcZJP/76B9VvHWZ5bCkP1+KdfCY0lk3wIEq5vRfb8=,iv:RNNjlV3OFtXn1N0a5fEb/3FWzcHX19wtCLMdaVlKNJ0=,tag:8iU5oFVbzd0eMe5Mo1PiAw==,type:str]
plausible-secret-key-base: ENC[AES256_GCM,data:ylakPGzY4S9640krl0fxYgm0Getf0+I7zthyTqTD/IpVhz5xgYBYx3Y2lSNa9Oi9yQ7+f9OdOBC6nc7n6MuUBg==,iv:YLPax/cRjMdIFti26gJd8COKr+3jXNZ7HCA5VvQVyAo=,tag:LHqYi590oEIp1IihLcFTtw==,type:str] plausible-secret-key-base: ENC[AES256_GCM,data:ylakPGzY4S9640krl0fxYgm0Getf0+I7zthyTqTD/IpVhz5xgYBYx3Y2lSNa9Oi9yQ7+f9OdOBC6nc7n6MuUBg==,iv:YLPax/cRjMdIFti26gJd8COKr+3jXNZ7HCA5VvQVyAo=,tag:LHqYi590oEIp1IihLcFTtw==,type:str]
nextcloud-admin-password: ENC[AES256_GCM,data:QaoSZyommeGED3nWNru92UVO2tjk24HE9fWX7ExYT101o4ZL411TmV1TXHSyfwjmE7yLIm1K/j4xpEbIY3zvFg==,iv:xC5EZVPHumVPOob5jiiXMFAmdFQcFSUPtZgioAgGDDs=,tag:Q/kY38XWkGsqcmCkd2lodg==,type:str] nextcloud-admin-password: ENC[AES256_GCM,data:QaoSZyommeGED3nWNru92UVO2tjk24HE9fWX7ExYT101o4ZL411TmV1TXHSyfwjmE7yLIm1K/j4xpEbIY3zvFg==,iv:xC5EZVPHumVPOob5jiiXMFAmdFQcFSUPtZgioAgGDDs=,tag:Q/kY38XWkGsqcmCkd2lodg==,type:str]
grafana-admin-password: ENC[AES256_GCM,data:SpxQ7FgFoF5cZj5+1ug=,iv:NaQPIqFE62PHC14rT/xqYchdt7IykS8jJhuGRcC2SjM=,tag:Q8QtHiE4Beh5GG/IcvjG4w==,type:str]
netlify-ddns-password: ENC[AES256_GCM,data:mz9MS93ZPbtziwo56DP27q5ZgA1rgCptQpgTPrq2Ihc3KjSxSACJ6p6t8NjRPr4lSDLPzDa47OnRct/N4fcm5Q==,iv:upOh9S0wvTXBwfso3GhQzpl5befY0T0hTW/LGNcvv0k=,tag:/LNP0wIaxtExulV0blVkXA==,type:str] netlify-ddns-password: ENC[AES256_GCM,data:mz9MS93ZPbtziwo56DP27q5ZgA1rgCptQpgTPrq2Ihc3KjSxSACJ6p6t8NjRPr4lSDLPzDa47OnRct/N4fcm5Q==,iv:upOh9S0wvTXBwfso3GhQzpl5befY0T0hTW/LGNcvv0k=,tag:/LNP0wIaxtExulV0blVkXA==,type:str]
grafana-smtp-password: ENC[AES256_GCM,data:eSzFlEcgSPEy7p0QW6Pr6Z86TRHuuIJcM7nSI7bBBFy/9/VQaYk6+Ztu049ZGrejPNk=,iv:o14YoiTE4dCKw/Rbh/B2m2b5oyitvaB+FnLxydgu75c=,tag:4iRngd9OiZMq5RTVKdklHw==,type:str]
#ENC[AES256_GCM,data:IDauOj95sPt6LQkNWOaAV3AR7XPHJljX7Gef/IgtzC227ln7aKpVLCbhxD6pNTwd9/KhIXJp3vagCjfgkO/utA==,iv:Pn5jIPsFMBA2xnp3SUBgBug1NN8d3h3zy1pGVzO2hO0=,tag:NzhLA7nqE7SRRMV+rKgCjQ==,type:comment] #ENC[AES256_GCM,data:IDauOj95sPt6LQkNWOaAV3AR7XPHJljX7Gef/IgtzC227ln7aKpVLCbhxD6pNTwd9/KhIXJp3vagCjfgkO/utA==,iv:Pn5jIPsFMBA2xnp3SUBgBug1NN8d3h3zy1pGVzO2hO0=,tag:NzhLA7nqE7SRRMV+rKgCjQ==,type:comment]
forgejo-runner.env: ENC[AES256_GCM,data:x4EaDzK4W34ZEZ/Inakore2YABZf8e7TBBjoC6xTPZ9GBrSZCE85FOcHAmMXPDo=,iv:bNGOsLnhxnlC/opCKT1DSsGoWdmgJ8NgEPY3ySlN108=,tag:Ijp3qHBSdv6EDaZdomJhAA==,type:str] forgejo-runner.env: ENC[AES256_GCM,data:x4EaDzK4W34ZEZ/Inakore2YABZf8e7TBBjoC6xTPZ9GBrSZCE85FOcHAmMXPDo=,iv:bNGOsLnhxnlC/opCKT1DSsGoWdmgJ8NgEPY3ySlN108=,tag:Ijp3qHBSdv6EDaZdomJhAA==,type:str]
jland.env: ENC[AES256_GCM,data:u+QKwKWG9NFduuofhe3aatof3KoC0N4ZpNOD8E/7l0BTSoTe5Tqmz5/33EOcBUw99+YLFR4kTJwdUmLWHk4UD87aGsJ4liPCtXnBsToAzBGg0I3mhGQ/QM8iKXMW9oKb3ciapitQBuJa1WIp5/bHNtCXWQ==,iv:iZDET5EWM4DnAoQqLP9+Ll4S+mFHt2wZ3ENtN79Dbqw=,tag:qVpocN3FxlHfte2hAmtGPA==,type:str] jland.env: ENC[AES256_GCM,data:u+QKwKWG9NFduuofhe3aatof3KoC0N4ZpNOD8E/7l0BTSoTe5Tqmz5/33EOcBUw99+YLFR4kTJwdUmLWHk4UD87aGsJ4liPCtXnBsToAzBGg0I3mhGQ/QM8iKXMW9oKb3ciapitQBuJa1WIp5/bHNtCXWQ==,iv:iZDET5EWM4DnAoQqLP9+Ll4S+mFHt2wZ3ENtN79Dbqw=,tag:qVpocN3FxlHfte2hAmtGPA==,type:str]
@ -26,8 +24,6 @@ api.lyte.dev: ENC[AES256_GCM,data:14C5GQ41m/g7qHPzxlYoWjKWDOcm7MEDkuSofiuLfRNc/n
restic-rascal-passphrase: ENC[AES256_GCM,data:yonKbBh4riGwxc/qcj8F/qrgAtA1sWhYejw9rdOTdCNW3a7zL/Ny1+XCI/P3bMOsY6UTmg/gxA2itp4cSbvqjg==,iv:5GwaEExn7b3dIkCVehLxaBXW+nUuSexY/bcqfCUwF5Q=,tag:dinyyw2XeVoSnw/IsYfK0w==,type:str] restic-rascal-passphrase: ENC[AES256_GCM,data:yonKbBh4riGwxc/qcj8F/qrgAtA1sWhYejw9rdOTdCNW3a7zL/Ny1+XCI/P3bMOsY6UTmg/gxA2itp4cSbvqjg==,iv:5GwaEExn7b3dIkCVehLxaBXW+nUuSexY/bcqfCUwF5Q=,tag:dinyyw2XeVoSnw/IsYfK0w==,type:str]
restic-rascal-ssh-private-key: ENC[AES256_GCM,data:ddsOs0XsayyQI9qc6LzwQpdDnfwNpbj8PbBJ5fyuqtlVNYndeLxaYcbZI2ULSUhgR1tN0FS+ggGTHQhVvjwksNvpskUGHNKkSLKH3D/mn5N9tsoeAblN4gZsloZdqXBVzEehumcQMdhh6iy6NkNbuinKrVKDhLV25PrFKuSBEYw9VHU7HAMW5Tfop3RzBXjZWETCDAR2OQa7d1dXsJ0Kw6b9RFmRe5MGQ0J7YhjdTg26JGMMVSeHvr5UbiUJkGA5RvOLEDM2Dfai7Lf8yRPZVxUl+rdRsNvNYEoYGu5rGLUFcuqIbQ+s40dP2uXwWauwkIvHUjEahkbP0httj4Kg3qIJBRPg7OuS+MOwAnLEAs3hl5zeBV396yA9qjWW8nhnbml58/uFFbfXbJWTM3r8cMpFbHKD+Ojo/99fm5Vy3pAMzNzEsHOaT+iyDYyNkV5OH1GyKK9n7kIRLdqmWe7GmaKXlwVvNUPi3RvLX9VXq83a4BuupFyTmaNfPGMs/17830aleV674+QVgKh3VyFtuJy6KBpMXDv16wFo,iv:S2I3h6pmKLxEc29E0zn2b8lscqA//5/ZMTV9q+/tdvs=,tag:ALeCT+nrVPDfS21xC555sA==,type:str] restic-rascal-ssh-private-key: ENC[AES256_GCM,data:ddsOs0XsayyQI9qc6LzwQpdDnfwNpbj8PbBJ5fyuqtlVNYndeLxaYcbZI2ULSUhgR1tN0FS+ggGTHQhVvjwksNvpskUGHNKkSLKH3D/mn5N9tsoeAblN4gZsloZdqXBVzEehumcQMdhh6iy6NkNbuinKrVKDhLV25PrFKuSBEYw9VHU7HAMW5Tfop3RzBXjZWETCDAR2OQa7d1dXsJ0Kw6b9RFmRe5MGQ0J7YhjdTg26JGMMVSeHvr5UbiUJkGA5RvOLEDM2Dfai7Lf8yRPZVxUl+rdRsNvNYEoYGu5rGLUFcuqIbQ+s40dP2uXwWauwkIvHUjEahkbP0httj4Kg3qIJBRPg7OuS+MOwAnLEAs3hl5zeBV396yA9qjWW8nhnbml58/uFFbfXbJWTM3r8cMpFbHKD+Ojo/99fm5Vy3pAMzNzEsHOaT+iyDYyNkV5OH1GyKK9n7kIRLdqmWe7GmaKXlwVvNUPi3RvLX9VXq83a4BuupFyTmaNfPGMs/17830aleV674+QVgKh3VyFtuJy6KBpMXDv16wFo,iv:S2I3h6pmKLxEc29E0zn2b8lscqA//5/ZMTV9q+/tdvs=,tag:ALeCT+nrVPDfS21xC555sA==,type:str]
restic-ssh-priv-key-benland: ENC[AES256_GCM,data:G+uiYZTvqXhpJb66j6Q6S+otlXeRX0CdYeMHzSMjIbvbI0AVm0yCU7COO5/O8i47NpvrKKS1kVxVEK8ixLRUowkl3hgRXhxsBIPFnpkMD0ENmJttm4HOpi0qIWMwzPYTjkz/slY4HcTFnCfYy1ZpURQdWwZsr1EdAA05bUMTtM22R3uOMzjO8uf72PCWX7yffo8MxsLmWvNVAOhVlrb2H5KQNR/IquFK3TFoZitq5nVDG9tcEFkX+lgA3zsmCHU/2DvvodgeRoltaAFvgjVznNGf4e5p8owHUtSzX52HwGZRiUlMuhpre2gm1r73n8AyZe41II+LX/85fMfZDdyayIGv3AAMBib8H0/AoChexRcdLQEmzOgRrXsgucDJrWSWP6WMBVyamUm79m5ep0fvL1lJftuJqN0uuq9dBrispdso4x+6jk/pDf5pEM/FE6s1rY832BEb7q0PnjyvVogOez+cIihmMpDdnS0A/8TFzg29i3C+93x5vrt3k7atNzR/jN+/GqX2FKLzxWrrIw2d,iv:IP+N8JQu+XRvwTtBnxu54ujzU5UliltXG3mk9HfJaN8=,tag:4oinE9QMaSh8IfUd/ttM3Q==,type:str] restic-ssh-priv-key-benland: ENC[AES256_GCM,data:G+uiYZTvqXhpJb66j6Q6S+otlXeRX0CdYeMHzSMjIbvbI0AVm0yCU7COO5/O8i47NpvrKKS1kVxVEK8ixLRUowkl3hgRXhxsBIPFnpkMD0ENmJttm4HOpi0qIWMwzPYTjkz/slY4HcTFnCfYy1ZpURQdWwZsr1EdAA05bUMTtM22R3uOMzjO8uf72PCWX7yffo8MxsLmWvNVAOhVlrb2H5KQNR/IquFK3TFoZitq5nVDG9tcEFkX+lgA3zsmCHU/2DvvodgeRoltaAFvgjVznNGf4e5p8owHUtSzX52HwGZRiUlMuhpre2gm1r73n8AyZe41II+LX/85fMfZDdyayIGv3AAMBib8H0/AoChexRcdLQEmzOgRrXsgucDJrWSWP6WMBVyamUm79m5ep0fvL1lJftuJqN0uuq9dBrispdso4x+6jk/pDf5pEM/FE6s1rY832BEb7q0PnjyvVogOez+cIihmMpDdnS0A/8TFzg29i3C+93x5vrt3k7atNzR/jN+/GqX2FKLzxWrrIw2d,iv:IP+N8JQu+XRvwTtBnxu54ujzU5UliltXG3mk9HfJaN8=,tag:4oinE9QMaSh8IfUd/ttM3Q==,type:str]
paperless-superuser-password: ENC[AES256_GCM,data:lypWK73mOYI2hyQAW/4T3cDiVtsts3kKb7LZb9ES3n97Kn5l,iv:jBHUBFbb4GqQ3gnK0h5VCaGj3/kd3/eGa1QFiE7+B9I=,tag:UoQar+x1xVnCV2k+9hYjWA==,type:str]
factorio-server-settings: ENC[AES256_GCM,data:KlHkHGenkoLtqt0YCETwQdhH0tvvqsyake3lC9Wimso3Y8IXvDfkLpOTE53Jq4frf1QMJh0LYyle+AmIgGvB0gAp/4fM1E4Ah9JPtKkcjVPyQIypuaDsPaVQMxMlJt1+TLX2fbSWdxOo0lulNg==,iv:AHq37PY3ZxKF0+ClUrSvhJSBuXFtGZLBZW/ZADrVqLI=,tag:B0gFyy6rmd6CGJfzAhO02A==,type:str]
sops: sops:
kms: [] kms: []
gcp_kms: [] gcp_kms: []
@ -52,8 +48,8 @@ sops:
bGpacHFRSkJYUUMwOEh4cVBXZ1NESmsKa5EhZ7148ojCqZldukLcPLr93HqnpNgq bGpacHFRSkJYUUMwOEh4cVBXZ1NESmsKa5EhZ7148ojCqZldukLcPLr93HqnpNgq
rMI0Nyz4Z4lkTVMRpA94zyNTkNwJ02/CYcKi8EJi6jGZnNPUTcnTwg== rMI0Nyz4Z4lkTVMRpA94zyNTkNwJ02/CYcKi8EJi6jGZnNPUTcnTwg==
-----END AGE ENCRYPTED FILE----- -----END AGE ENCRYPTED FILE-----
lastmodified: "2024-10-22T22:31:46Z" lastmodified: "2024-09-06T21:22:57Z"
mac: ENC[AES256_GCM,data:nCGtkRXZuo3SZLjL2I3fJelaS1g9U4SVdzPZlZPgXzCWVyxokIMFwoSM15HgDu5KsFR+3kIfWVzIQk/lwt9lQPG3O6iUkfPRsIg0dnVrNSauNk0QXR91vCVlDmbFuDUf0C4EVrbE9RRgHzGzToSJYxQHSInMYVhJBcBfdbYZF9A=,iv:qu6p45+ATOs5Ms3bqM8ynXK0tKnN3wNmtwAsc2DSQbU=,tag:xpTeHWawPXfeqq/azPIPPg==,type:str] mac: ENC[AES256_GCM,data:suoBGuZnfZpo55g+sq6MXDvecwhhWRS9gtTlCvnWmSvWT+K8TFXHcz9cLZT5U2N4ueSYJovRoKPoAv9rKgtLHSSg+JKI0b0cErQge75970bTbeMKMl+SJmYF0T0ht5+8n5zjhnQjVo2mHmJJI1IekumsoNJ9+F6USPBidiK0uNU=,iv:7dMsEnXylvn0vVfmU9pQt1BgrqfKdSyoBbNTUZ782Uo=,tag:E3u9LVcdTKa7mjAxQ/m9rw==,type:str]
pgp: [] pgp: []
unencrypted_suffix: _unencrypted unencrypted_suffix: _unencrypted
version: 3.9.0 version: 3.9.0

View file

@ -1,30 +0,0 @@
ddns-pass: ENC[AES256_GCM,data:/Dpjl761JLHTM+we1PJs7pkcHcWzBk0jQ1bP4plOYGS4N3vXhXn1bHCYmENlrOwU3riETBZ5OeRA1LvFNZHPQw==,iv:LbgN5utHUBZRV49e6ux7HPG0xt4ydTqyZA+NZuaJnWs=,tag:l0VRaMJ6ie63lej6mZTMPg==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1stdue5q5teskee057ced6rh9pzzr93xsy66w4sc3zu49rgxl7cjshztt45
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBCTitMaFRiK1BSMEcwRmNk
Q0hmOGlZSFpkUUhyZkkwSU40QXB5cmlkR1FRCkRhbVBXQ2FjUzRhdEhrSEZKcWhM
dTNuVUljU0NSbVQzbXhZeFNENmN5QjgKLS0tIDFncEMrUCtWWTMyUGZIelY5aXB4
NmJWeDFSVVoxZCtRWlhNNXNyVWRvY28KgPbg6RScxBrxI0DvD6R7iKm8/70kJLdG
FhbgK9d/7UPMfefluEah7vKzXV/dn+/4KsCJuKFFZ1AsM5hDFQ+JGQ==
-----END AGE ENCRYPTED FILE-----
- recipient: age1ez4why08hdx0qf940cjzs6ep4q5rk2gqq7lp99pe58fktpwv65esx4xrht
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBXa1owK21QNUovZzZHekpw
OWdsSy9ZcmhGNzc1enNGVHRHTTlSb1E5UEJJCkF3MlpYQ1c5UGNySk94aENHMDh2
ME1rUlZscHFYSUVwOWFSczZGV2Z5aEEKLS0tIFlXTUFZaVJtWXltZGdEZzJPSjFJ
bTdCNS9zMzdvT2NiZVRyT1JzVmRFUFEKguq2i4rnVvGECZlUcEEubXfv4Ya/zI1N
3mWQslPHgnnWuwG7flbvafHYnyZCXsMqNKnNDM6wayDgKAbtCx3Syg==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-09-14T12:41:15Z"
mac: ENC[AES256_GCM,data:sO3omCYH1urB/qcW3VippCinCUO1cmp5KrUSQk5ms7k+i9xUhdL3tTYHGVTa4PHV6VluukKnHuwAijo+rneNdCeMdIkAEskk/X6SDYgkwmjXuNcNEA4la22EqSrenJ8W3UafHDvP8+vpUKAzVo0E82Vmo9/YNJaqvqQM8PtciSc=,iv:2GboNZpAezZsWK3CbcwVw40zW4CucP3JhsYlvZ/Hy2M=,tag:w3XmkN76oYV+PmliPB01MQ==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0

View file

@ -1,30 +0,0 @@
netlify-ddns-password: ENC[AES256_GCM,data:zp58uV2L+/n/9Cvp1BnQBhdfmNfuyH8C73R6JYrJ3pw0QbEpPpIWuzod9S28QxNq50Bj5/zGzE+D125dkYFX0A==,iv:kceEl04Nb6LWcyjl2fHYjsl0RSO8OulN3DKlDLwjIu4=,tag:nOi2H56dEX9K5okaiDaWOQ==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1stdue5q5teskee057ced6rh9pzzr93xsy66w4sc3zu49rgxl7cjshztt45
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBiQlZqSzBaTUROMkp2K2xI
Z0ZIdllGNnlNYnFtVERPbVN6Y1FnWC9aeGlFCnZYci9CblA3VFZsOG5OOXE3cDZj
TlZkbU0yY0F1ZDA5amczRVFldU1ZWGcKLS0tIEFTdi9uRFdlQW1MbUdSdm9jRW5n
emxsSGN2b3JLZGNYQmVDYk96QUY5aVEK0w7Q/zEsIJKFcQjhgQovmRs4Iv6bhuaz
cKn8M/p8dG+p5G50ALsiIiuTFBUM7vmFVF000PxqsEFr0Yl6eDg+uA==
-----END AGE ENCRYPTED FILE-----
- recipient: age1zd7c3g5d20shdftq8ghqm0r92488dg4pdp4gulur7ex3zx2yq35ssxawpn
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBZK1lRTlRIc2ZxcllsRFRp
aEZIOC80TSt2Ly9MUEdiVGQ5akkrUUJwcDFJClIyMUl0SWY3TXFLcWl0TGw3K3VM
N0VWaGpCaVp6MXg4M2pwcnNhNkhPYjQKLS0tIEZOVGVTcUxaMmxBNEVJQ2VFSjRm
L2lpaExJM2FkUFdqa3JpalZmOFZYV0kKmXlu5CUIYnNEOlIco3JveS7KdiF2yWTn
r/KOKA9/v3zPbnsYc+HETxYNy1OWrQ/qDGIbR6jz8L5+v35FN+larw==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-09-13T05:37:38Z"
mac: ENC[AES256_GCM,data:r1qpYSojCuN84FYX1c684XifKMKUPTOl7dvzuoYYuLf+mwbZrD4fUErDmZczzA4g2ttSNNv05bEq5D7XgfoXPcbhqtj/jggxvX4EGLltpo3Jy77EyKabr1c7KsYV3ciYT13sRGzFYrge06wVrUUPpozPfvAbp1qv0CwK4dUg4dc=,iv:Bpnrx8KcZnWkld4f3VRl39xMmaU388KQunig9xohUto=,tag:vKUupMf/dRb5bY8BMV4oVw==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0

View file

@ -1 +0,0 @@
flake.lock

View file

@ -1,16 +1,79 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
git-hooks.url = "github:cachix/git-hooks.nix";
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = inputs: let outputs = {
inherit (import nix/boilerplate.nix inputs) call; self,
nixpkgs,
...
}: let
inherit (self) outputs;
supportedSystems = [
"aarch64-linux"
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
overlay = final: prev: {
erlangPackages = prev.beam.packagesWith prev.erlang_26;
erlang = final.erlangPackages.erlang;
elixir = final.erlangPackages.elixir_1_16;
mixRelease = final.erlangPackages.mixRelease.override {
elixir = final.elixir;
};
fetchMixDeps = final.erlangPackages.fetchMixDeps.override {
elixir = final.elixir;
};
elixir-ls = prev.elixir-ls.override {elixir = final.elixir;};
};
nixpkgsFor = system: ((import nixpkgs {inherit system;}).extend overlay);
in { in {
overlays = import nix/overlays.nix; packages = forAllSystems (system: let
packages = call (import nix/packages.nix); pkgs = nixpkgsFor system;
checks = call (import nix/checks.nix);
devShells = call (import nix/shells.nix); inherit (pkgs) beamPackages;
inherit (beamPackages) mixRelease fetchMixDeps;
version = "0.1.0";
src = ./.;
pname = "api.lyte.dev";
in {
# this-package = mixRelease {
# inherit pname version src;
# mixFodDeps = fetchMixDeps {
# inherit version src;
# pname = "mix-deps-${pname}";
# hash = pkgs.lib.fakeSha256;
# };
# buildInputs = with pkgs; [sqlite];
# HOME = "$(pwd)";
# MIX_XDG = "$HOME";
# };
# default = outputs.packages.${system}.this-package;
});
devShells = forAllSystems (system: let
pkgs = nixpkgsFor system;
in {
default = pkgs.mkShell {
shellHook = "export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive";
buildInputs = with pkgs; [
elixir
elixir-ls
inotify-tools
];
};
});
}; };
} }

View file

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

View file

@ -1,17 +0,0 @@
{
git-hooks,
pkgs,
...
}: {
git-hooks = git-hooks.lib.${pkgs.system}.run {
src = ./..;
hooks = {
alejandra.enable = true;
convco.enable = true;
credo.enable = true;
dialyzer.enable = true;
mix-format.enable = true;
mix-test.enable = true;
};
};
}

View file

@ -1,9 +0,0 @@
{
forSelf = final: prev: {
erlang = prev.beam.packagesWith prev.beam.interpreters.erlang_27;
elixir = final.erlang.elixir_1_18;
mixRelease = final.erlang.mixRelease.override {elixir = final.elixir;};
fetchMixDeps = final.erlang.fetchMixDeps.override {elixir = final.elixir;};
elixir-ls = prev.elixir-ls.override {elixir = final.elixir;};
};
}

View file

@ -1,24 +0,0 @@
{
pkgs,
self,
...
}: let
version = "1.0.0";
src = ../.;
pname = "my-package";
in {
${pname} = pkgs.mixRelease {
inherit pname version src;
mixFodDeps = pkgs.fetchMixDeps {
inherit version src;
pname = "mix-deps-${pname}";
sha256 = pkgs.lib.fakeSha256;
};
# buildInputs = with pkgs; [];
# HOME = "$(pwd)";
# MIX_XDG = "$HOME";
# RELEASE_COOKIE = "test-cookie";
};
default = self.packages.${pkgs.system}.${pname};
}

View file

@ -1,15 +0,0 @@
{
pkgs,
# self,
...
}: {
elixir-dev = pkgs.mkShell {
shellHook = "export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive";
# inputsFrom = [self.packages.${pkgs.system}.my-package];
buildInputs = with pkgs; [
elixir
elixir-ls
inotify-tools
];
};
}

View file

@ -35,14 +35,12 @@
default = self.outputs.devShells.${pkgs.system}.nix; default = self.outputs.devShells.${pkgs.system}.nix;
}); });
/* # packages = genPkgs (pkgs: import ./pkgs {inherit pkgs;});
packages = genPkgs (pkgs: import ./pkgs {inherit pkgs;}); # overlays = import ./overlays self;
overlays = import ./overlays self; # nixosModules = import ./modules/nixos;
nixosModules = import ./modules/nixos; # homeManagerModules = import ./modules/home-manager;
homeManagerModules = import ./modules/home-manager; # nixosConfigurations = import ./nixos;
nixosConfigurations = import ./nixos; # homeConfigurations = import ./home
homeConfigurations = import ./home # templates = import ./templates;
templates = import ./templates;
*/
}; };
} }

View file

@ -20,12 +20,14 @@
src = ./.; src = ./.;
hooks = { hooks = {
alejandra.enable = true; alejandra.enable = true;
cargo-check.enable = true; # NOTE: These do not work well with `nix flake check` due to pure environments
clippy = { # https://github.com/cachix/git-hooks.nix/issues/452
enable = true; # cargo-check.enable = true;
packageOverrides.cargo = pkgs.cargo; # clippy = {
packageOverrides.clippy = pkgs.rustPackages.clippy; # enable = true;
}; # packageOverrides.cargo = pkgs.cargo;
# packageOverrides.clippy = pkgs.rustPackages.clippy;
# };
rustfmt = { rustfmt = {
enable = true; enable = true;
packageOverrides.rustfmt = pkgs.rustfmt; packageOverrides.rustfmt = pkgs.rustfmt;
@ -36,18 +38,16 @@
packages = genPkgs (pkgs: { packages = genPkgs (pkgs: {
my-package = pkgs.rustPlatform.buildRustPackage { my-package = pkgs.rustPlatform.buildRustPackage {
pname = "my-package"; pname = "kodotag";
version = "0.1.0"; version = "0.1.0";
/* # nativeBuildInputs = with pkgs; [
nativeBuildInputs = with pkgs; [ # pkg-config
pkg-config # clang
clang # ];
];
buildInputs = with pkgs; [ # buildInputs = with pkgs; [
]; # ];
*/
src = ./.; src = ./.;
hash = pkgs.lib.fakeHash; hash = pkgs.lib.fakeHash;