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

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -5,9 +5,11 @@
lib,
# font,
...
}: let
}:
let
inherit (style) colors;
in {
in
{
# TODO: Hyprland seems to sometimes use a ton of CPU?
home.packages = with pkgs; [
@ -64,9 +66,9 @@ in {
kb_options = "ctrl:nocaps";
/*
kb_variant =
kb_model =
kb_rules =
kb_variant =
kb_model =
kb_rules =
*/
follow_mouse = 2;
@ -114,10 +116,10 @@ in {
rounding_power = 4.0;
/*
blur = "no";
blur_size = 3
blur_passes = 1
blur_new_optimizations = on
blur = "no";
blur_size = 3
blur_passes = 1
blur_new_optimizations = on
*/
shadow = {
@ -134,8 +136,8 @@ in {
bind = [
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
/*
"$mod, return, exec, wezterm"
"$mod SHIFT, return, exec, wezterm"
"$mod, return, exec, wezterm"
"$mod SHIFT, return, exec, wezterm"
*/
"$mod, return, exec, wezterm"
"$mod SHIFT, return, exec, [float] wezterm start --always-new-process"
@ -217,7 +219,10 @@ in {
];
# Move/resize windows with mod + LMB/RMB and dragging
bindm = ["$mod, mouse:272, movewindow" "$mod, mouse:273, resizewindow"];
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
};
extraConfig = ''
@ -376,55 +381,57 @@ in {
};
};
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";
};
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'';
}
];
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

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

View file

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

View file

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

View file

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

View file

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

View file

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

File diff suppressed because it is too large Load diff

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,16 +1,21 @@
inputs @ {
inputs@{
nixpkgs,
self,
...
}: let
}:
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"];
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);
pkgsFor = system: ((import nixpkgs { inherit system; }).extend forSelfOverlay);
genPkgs = func: (forSystems (system: func (pkgsFor system)));
call = imported: genPkgs (pkgs: imported (inputs // {inherit pkgs;}));
call = imported: genPkgs (pkgs: imported (inputs // { inherit pkgs; }));
}

View file

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

View file

@ -2,8 +2,8 @@
forSelf = final: prev: {
erlang = prev.beam.packagesWith prev.beam.interpreters.erlang_27;
elixir = final.erlang.elixir_1_17;
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;};
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

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,16 +1,24 @@
inputs @ {
inputs@{
nixpkgs,
self,
...
}: let
}:
let
forSelfOverlay =
if builtins.hasAttr "overlays" self && 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"];
if builtins.hasAttr "overlays" self && 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);
pkgsFor = system: ((import nixpkgs { inherit system; }).extend forSelfOverlay);
genPkgs = func: (forSystems (system: func (pkgsFor system)));
call = imported: genPkgs (pkgs: imported (inputs // {inherit pkgs;}));
call = imported: genPkgs (pkgs: imported (inputs // { inherit pkgs; }));
}

View file

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

View file

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

View file

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

View file

@ -1 +0,0 @@

View file

@ -1,6 +1,7 @@
{nixpkgs, ...}: {
{ nixpkgs, ... }:
{
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 = {
name = "IosevkaLyteTerm";
@ -9,11 +10,11 @@
};
/*
moduleArgs = {
# inherit style;
inherit helix slippi hyprland hardware disko home-manager;
inherit (outputs) nixosModules homeManagerModules diskoConfigurations overlays;
};
moduleArgs = {
# inherit style;
inherit helix slippi hyprland hardware disko home-manager;
inherit (outputs) nixosModules homeManagerModules diskoConfigurations overlays;
};
*/
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev";

View file

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

View file

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

View file

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

View file

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

File diff suppressed because it is too large Load diff

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -5,7 +5,8 @@
outputs,
modulesPath,
...
}: {
}:
{
nixpkgs.hostPlatform = "aarch64-linux";
networking.hostName = "htpifour";
@ -31,11 +32,15 @@
console.enable = false;
home-manager.users.daniel = {
imports = with outputs.homeManagerModules; [linux-desktop wallpaper-manager];
imports = with outputs.homeManagerModules; [
linux-desktop
wallpaper-manager
];
};
environment.systemPackages = with pkgs;
#with pkgs;
environment.systemPackages =
with pkgs;
#with pkgs;
[
# libcec
libraspberrypi
@ -59,17 +64,17 @@
nixpkgs.overlays = [
/*
nixos-22.05
(self: super: { libcec = super.libcec.override { inherit (self) libraspberrypi; }; })
nixos-22.11
(self: super: {libcec = super.libcec.override {withLibraspberrypi = true;};})
nixos-22.05
(self: super: { libcec = super.libcec.override { inherit (self) libraspberrypi; }; })
nixos-22.11
(self: super: {libcec = super.libcec.override {withLibraspberrypi = true;};})
*/
];
# Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
/*
systemd.services."getty@tty1".enable = false;
systemd.services."autovt@tty1".enable = false;
systemd.services."getty@tty1".enable = false;
systemd.services."autovt@tty1".enable = false;
*/
# hardware
@ -82,7 +87,11 @@
boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_rpi4;
initrd.availableKernelModules = ["xhci_pci" "usbhid" "usb_storage"];
initrd.availableKernelModules = [
"xhci_pci"
"usbhid"
"usb_storage"
];
loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
@ -99,43 +108,43 @@
allowedTCPPorts = [
22 # ssh
];
allowedUDPPorts = [];
allowedUDPPorts = [ ];
};
};
/*
services.udev.extraRules = ''
# 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"
'';
services.udev.extraRules = ''
# 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"
'';
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
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`
systemd.sockets."cec-client" = {
after = ["dev-vchiq.device"];
bindsTo = ["dev-vchiq.device"];
wantedBy = ["sockets.target"];
socketConfig = {
ListenFIFO = "/run/cec.fifo";
SocketGroup = "video";
SocketMode = "0660";
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`
set pi as active source: `echo 'as' &gt; /run/cec.fifo`
systemd.sockets."cec-client" = {
after = ["dev-vchiq.device"];
bindsTo = ["dev-vchiq.device"];
wantedBy = ["sockets.target"];
socketConfig = {
ListenFIFO = "/run/cec.fifo";
SocketGroup = "video";
SocketMode = "0660";
};
};
};
systemd.services."cec-client" = {
after = ["dev-vchiq.device"];
bindsTo = ["dev-vchiq.device"];
wantedBy = ["multi-user.target"];
serviceConfig = {
ExecStart = ''${pkgs.libcec}/bin/cec-client -d 1'';
ExecStop = ''/bin/sh -c "echo q &gt; /run/cec.fifo"'';
StandardInput = "socket";
StandardOutput = "journal";
Restart = "no";
systemd.services."cec-client" = {
after = ["dev-vchiq.device"];
bindsTo = ["dev-vchiq.device"];
wantedBy = ["multi-user.target"];
serviceConfig = {
ExecStart = ''${pkgs.libcec}/bin/cec-client -d 1'';
ExecStop = ''/bin/sh -c "echo q &gt; /run/cec.fifo"'';
StandardInput = "socket";
StandardOutput = "journal";
Restart = "no";
};
};
};
*/
hardware.graphics.driSupport32Bit = lib.mkForce false;

View file

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

File diff suppressed because it is too large Load diff

View file

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

View file

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

View file

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

View file

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