Formatting + update

This commit is contained in:
Aleksandr Lebedev 2025-07-25 22:56:40 +02:00
parent 93de64c64e
commit 9c895e9cc0
61 changed files with 2350 additions and 2100 deletions

View file

@ -1,5 +1,7 @@
{ device, swapSize ? "16G" }:
{ {
device,
swapSize ? "16G",
}: {
disko.devices = { disko.devices = {
disk.${device} = { disk.${device} = {
type = "disk"; type = "disk";
@ -7,7 +9,8 @@
content = { content = {
type = "gpt"; # Initialize the disk with a GPT partition table type = "gpt"; # Initialize the disk with a GPT partition table
partitions = { partitions = {
ESP = { # Setup the EFI System Partition ESP = {
# Setup the EFI System Partition
type = "EF00"; # Set the partition type type = "EF00"; # Set the partition type
size = "1000M"; # Make the partition a gig size = "1000M"; # Make the partition a gig
content = { content = {
@ -16,7 +19,8 @@
mountpoint = "/boot"; # Mount it to /boot mountpoint = "/boot"; # Mount it to /boot
}; };
}; };
primary = { # Setup the LVM partition primary = {
# Setup the LVM partition
size = "100%"; # Fill up the rest of the drive with it size = "100%"; # Fill up the rest of the drive with it
content = { content = {
type = "lvm_pv"; # pvcreate type = "lvm_pv"; # pvcreate
@ -26,17 +30,22 @@
}; };
}; };
}; };
lvm_vg = { # vgcreate lvm_vg = {
vg1 = { # /dev/vg1 # vgcreate
vg1 = {
# /dev/vg1
type = "lvm_vg"; type = "lvm_vg";
lvs = { # lvcreate lvs = {
swap = { # Logical Volume = "swap", /dev/vg1/swap # lvcreate
swap = {
# Logical Volume = "swap", /dev/vg1/swap
size = swapSize; size = swapSize;
content = { content = {
type = "swap"; type = "swap";
}; };
}; };
root = { # Logical Volume = "root", /dev/vg1/root root = {
# Logical Volume = "root", /dev/vg1/root
size = "100%FREE"; # Use the remaining space in the Volume Group size = "100%FREE"; # Use the remaining space in the Volume Group
content = { content = {
type = "filesystem"; type = "filesystem";

View file

@ -1,5 +1,7 @@
{ device, mountpoint ? "/run/extraDrive" }:
{ {
device,
mountpoint ? "/run/extraDrive",
}: {
disko.devices = { disko.devices = {
disk = { disk = {
"${device}" = { "${device}" = {

View file

@ -1,7 +1,4 @@
{ {device ? throw "Set this to your disk device, e.g. /dev/sda", ...}: {
device ? throw "Set this to your disk device, e.g. /dev/sda",
...
}: {
disko.devices = { disko.devices = {
disk.main = { disk.main = {
inherit device; inherit device;

View file

@ -1,8 +1,4 @@
{ {device ? throw "Set this to your disk device, e.g. /dev/sda", ...}: {
device ? throw "Set this to your disk device, e.g. /dev/sda",
...
}:
{
disko.devices = { disko.devices = {
disk = { disk = {
main = { main = {
@ -73,10 +69,12 @@
depends = ["/persist"]; depends = ["/persist"];
neededForBoot = true; neededForBoot = true;
}; };
swapDevices = [{ swapDevices = [
{
device = "/persist/swapfile"; device = "/persist/swapfile";
size = 64 * 1024; # 64 GB size = 64 * 1024; # 64 GB
}]; }
];
boot.resumeDevice = "/persist/swapfile"; boot.resumeDevice = "/persist/swapfile";
} }

View file

@ -1,7 +1,4 @@
{ {device ? throw "Set this to your disk device, e.g. /dev/sda", ...}: {
device ? throw "Set this to your disk device, e.g. /dev/sda",
...
}: {
disko.devices = { disko.devices = {
disk.main = { disk.main = {
inherit device; inherit device;

18
flake.lock generated
View file

@ -333,11 +333,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1753393138, "lastModified": 1753476892,
"narHash": "sha256-mJp8QEFiVQNc3fZLf5zeKGIHeigMj33LYQ0EogcHz5g=", "narHash": "sha256-VZg9Oq9apTi2JEnlOSiCGl6iglwqNFr6A2u3CTWqGpQ=",
"owner": "kylekrein", "owner": "kylekrein",
"repo": "emacs-config", "repo": "emacs-config",
"rev": "f3880c6f9f32661dfae8d10f2fd522561dc73f25", "rev": "1b0367dca5e6b37e2ca9c53f41f2316a5bf335eb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -358,11 +358,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1753376867, "lastModified": 1753460825,
"narHash": "sha256-FAPCW/szK3qvCUD+ThOX4sFyqz/MSadJ4SltA8lNamc=", "narHash": "sha256-MNu9l5nukxFpT5LzsT7Q83BqmO36EByn6/o/xA7hu7I=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "b8df6094952273f3b7e5e7c99b96ed1bf9830034", "rev": "07c08ea0037b2fd7e0b5416361586d4552ac8255",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1233,11 +1233,11 @@
}, },
"nixpkgs-master": { "nixpkgs-master": {
"locked": { "locked": {
"lastModified": 1753468267, "lastModified": 1753473560,
"narHash": "sha256-KnwZCY92VjKvGyjnsnNHOvG9mllpFbKyeUkDpD//nvs=", "narHash": "sha256-bT4abIU3eGDraRATwkdeJAeIvxt9e23dhpjjp2dsRqg=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "dd386adc75a0061fbb9b1b62595dbc8c52330648", "rev": "a6b41ef5e0c274f96b1f1b52b3d382302763f62a",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -78,17 +78,18 @@
nixpkgs-unstable, nixpkgs-unstable,
... ...
} @ inputs: let } @ inputs: let
#systems = ["aarch64-linux" "x86_64-linux" ]; systems = ["aarch64-linux" "x86_64-linux"];
#forAllSystems = nixpkgs.lib.genAttrs systems; eachSystem = nixpkgs.lib.genAttrs systems;
#pkgs = import nixpkgs { pkgsFor = eachSystem (system:
# inherit system; import nixpkgs {
# config = { localSystem = system;
# allowUnfree = true; overlays = [
# }; ];
#}; });
arm = "aarch64-linux"; arm = "aarch64-linux";
x86 = "x86_64-linux"; x86 = "x86_64-linux";
ladybirdMaster = self: super: { ladybird = super.ladybird.overrideAttrs(old: { ladybirdMaster = self: super: {
ladybird = super.ladybird.overrideAttrs (old: {
src = super.fetchFromGitHub { src = super.fetchFromGitHub {
owner = "LadybirdWebBrowser"; owner = "LadybirdWebBrowser";
repo = "ladybird"; repo = "ladybird";
@ -96,16 +97,22 @@
hash = "sha256-hJkK7nag3Z9E8etPFCo0atUEJJnPjjkl7sle/UwkzbE="; hash = "sha256-hJkK7nag3Z9E8etPFCo0atUEJJnPjjkl7sle/UwkzbE=";
}; };
version = "0-unstable-2025-05-22"; version = "0-unstable-2025-05-22";
});}; });
};
nativePackagesOverlay = self: super: { nativePackagesOverlay = self: super: {
stdenv = super.impureUseNativeOptimizations super.stdenv; stdenv = super.impureUseNativeOptimizations super.stdenv;
}; };
kylekrein-homepc-pkgs = nixpkgs: import nixpkgs { kylekrein-homepc-pkgs = nixpkgs:
import nixpkgs {
system = x86; system = x86;
overlays = [ overlays = [
inputs.beeengine.overlays.${x86} inputs.beeengine.overlays.${x86}
(final: prev: { #https://github.com/NixOS/nixpkgs/issues/388681 (final: prev: {
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [( #https://github.com/NixOS/nixpkgs/issues/388681
pythonPackagesExtensions =
prev.pythonPackagesExtensions
++ [
(
python-final: python-prev: { python-final: python-prev: {
onnxruntime = python-prev.onnxruntime.overridePythonAttrs ( onnxruntime = python-prev.onnxruntime.overridePythonAttrs (
oldAttrs: { oldAttrs: {
@ -113,7 +120,8 @@
} }
); );
} }
)]; )
];
}) })
#nativePackagesOverlay #nativePackagesOverlay
#ladybirdMaster #ladybirdMaster
@ -124,7 +132,8 @@
cudaSupport = true; cudaSupport = true;
}; };
}; };
kylekrein-server-pkgs = nixpkgs: import nixpkgs { kylekrein-server-pkgs = nixpkgs:
import nixpkgs {
system = x86; system = x86;
overlays = [ overlays = [
(self: super: { (self: super: {
@ -138,7 +147,8 @@
allowUnfree = true; allowUnfree = true;
}; };
}; };
kylekrein-framework12-pkgs = nixpkgs: import nixpkgs { kylekrein-framework12-pkgs = nixpkgs:
import nixpkgs {
system = x86; system = x86;
overlays = [ overlays = [
inputs.beeengine.overlays.${x86} inputs.beeengine.overlays.${x86}
@ -148,7 +158,8 @@
allowUnfree = true; allowUnfree = true;
}; };
}; };
kylekrein-mac-pkgs = nixpkgs: import nixpkgs { kylekrein-mac-pkgs = nixpkgs:
import nixpkgs {
system = arm; system = arm;
overlays = [ overlays = [
inputs.beeengine.overlays.${arm} inputs.beeengine.overlays.${arm}
@ -162,7 +173,8 @@
allowUnsupportedSystem = true; allowUnsupportedSystem = true;
}; };
}; };
kylekrein-wsl-pkgs = nixpkgs: import nixpkgs { kylekrein-wsl-pkgs = nixpkgs:
import nixpkgs {
system = x86; system = x86;
overlays = [ overlays = [
#nativePackagesOverlay #nativePackagesOverlay
@ -171,7 +183,8 @@
allowUnfree = true; allowUnfree = true;
}; };
}; };
andrej-pc-pkgs = nixpkgs: import nixpkgs { andrej-pc-pkgs = nixpkgs:
import nixpkgs {
system = x86; system = x86;
overlays = [ overlays = [
inputs.beeengine.overlays.${x86} inputs.beeengine.overlays.${x86}
@ -186,6 +199,12 @@
first-nixos-install = "1729112485"; #stat -c %W / first-nixos-install = "1729112485"; #stat -c %W /
in { in {
formatter = eachSystem (
system: let
pkgs = pkgsFor.${system};
in
pkgs.alejandra
);
nixOnDroidConfigurations.default = inputs.nix-on-droid.lib.nixOnDroidConfiguration { nixOnDroidConfigurations.default = inputs.nix-on-droid.lib.nixOnDroidConfiguration {
pkgs = import nixpkgs { pkgs = import nixpkgs {
system = "aarch64-linux"; system = "aarch64-linux";
@ -329,7 +348,10 @@
system = x86; system = x86;
pkgs = andrej-pc-pkgs nixpkgs; pkgs = andrej-pc-pkgs nixpkgs;
modules = [ modules = [
(import ./disko/ext4-swap.nix {device = "/dev/sda"; swapSize = "16G";}) (import ./disko/ext4-swap.nix {
device = "/dev/sda";
swapSize = "16G";
})
(import ./disko/ext4.nix {device = "/dev/sdb";}) (import ./disko/ext4.nix {device = "/dev/sdb";})
./nixos/hosts/andrej-pc/configuration.nix ./nixos/hosts/andrej-pc/configuration.nix
]; ];

View file

@ -10,11 +10,10 @@
inputs, inputs,
unstable-pkgs, unstable-pkgs,
... ...
}: }: let
let in {
in imports =
{ [
imports = [
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
inputs.nixos-facter-modules.nixosModules.facter inputs.nixos-facter-modules.nixosModules.facter
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
@ -32,7 +31,8 @@ in
./modules/gnupg ./modules/gnupg
./modules/direnv ./modules/direnv
./hosts/${hwconfig.hostname} ./hosts/${hwconfig.hostname}
] ++ lib.optional (hwconfig.useImpermanence) ./modules/impermanence; ]
++ lib.optional (hwconfig.useImpermanence) ./modules/impermanence;
facter.reportPath = ./hosts/${hwconfig.hostname}/facter.json; facter.reportPath = ./hosts/${hwconfig.hostname}/facter.json;
kylekrein.services.autoUpgrade = { kylekrein.services.autoUpgrade = {
enable = true; enable = true;
@ -45,7 +45,10 @@ in
kernelPackages = lib.mkDefault pkgs.linuxPackages_6_14; kernelPackages = lib.mkDefault pkgs.linuxPackages_6_14;
loader = { loader = {
systemd-boot.enable = true; systemd-boot.enable = true;
efi.canTouchEfiVariables = if hwconfig.hostname != "kylekrein-mac" then true else false; efi.canTouchEfiVariables =
if hwconfig.hostname != "kylekrein-mac"
then true
else false;
}; };
# Hide the OS choice for bootloaders. # Hide the OS choice for bootloaders.
# It's still possible to open the bootloader list by pressing any key # It's still possible to open the bootloader list by pressing any key
@ -63,7 +66,6 @@ in
#flatpak #flatpak
#kk.services.flatpak.enable = hwconfig.system != "aarch64-linux"; #kk.services.flatpak.enable = hwconfig.system != "aarch64-linux";
services.flatpak.packages = [ services.flatpak.packages = [
]; ];
# Enable networking # Enable networking

View file

@ -1,5 +1,4 @@
{pkgs, ...}: {pkgs, ...}: {
{
programs.firefox.profiles.default.settings = { programs.firefox.profiles.default.settings = {
"media.gmp-widevinecdm.version" = pkgs.widevinecdm-aarch64.version; "media.gmp-widevinecdm.version" = pkgs.widevinecdm-aarch64.version;
"media.gmp-widevinecdm.visible" = true; "media.gmp-widevinecdm.visible" = true;
@ -20,5 +19,4 @@
''; '';
recursive = true; recursive = true;
}; };
} }

View file

@ -1,5 +1,4 @@
prev: final: prev: final: {
{
widevinecdm-aarch64 = import ./widevine.nix { widevinecdm-aarch64 = import ./widevine.nix {
inherit (final) stdenvNoCC fetchFromGitHub fetchurl python3 squashfsTools nspr; inherit (final) stdenvNoCC fetchFromGitHub fetchurl python3 squashfsTools nspr;
}; };

View file

@ -1,11 +1,11 @@
{ stdenvNoCC {
, fetchFromGitHub stdenvNoCC,
, fetchurl fetchFromGitHub,
, python3 fetchurl,
, squashfsTools python3,
, nspr squashfsTools,
}: nspr,
let }: let
widevine-installer = fetchFromGitHub { widevine-installer = fetchFromGitHub {
owner = "AsahiLinux"; owner = "AsahiLinux";
repo = "widevine-installer"; repo = "widevine-installer";
@ -13,13 +13,11 @@ let
sha256 = "sha256-XI1y4pVNpXS+jqFs0KyVMrxcULOJ5rADsgvwfLF6e0Y="; sha256 = "sha256-XI1y4pVNpXS+jqFs0KyVMrxcULOJ5rADsgvwfLF6e0Y=";
}; };
lacros-image = fetchurl { lacros-image = fetchurl {
url = url = let
let
distfiles_base = "https://commondatastorage.googleapis.com/chromeos-localmirror/distfiles"; distfiles_base = "https://commondatastorage.googleapis.com/chromeos-localmirror/distfiles";
lacros_name = "chromeos-lacros-arm64-squash-zstd"; lacros_name = "chromeos-lacros-arm64-squash-zstd";
lacrosVersion = "120.0.6098.0"; lacrosVersion = "120.0.6098.0";
in in "${distfiles_base}/${lacros_name}-${lacrosVersion}";
"${distfiles_base}/${lacros_name}-${lacrosVersion}";
hash = "sha256-OKV8w5da9oZ1oSGbADVPCIkP9Y0MVLaQ3PXS3ZBLFXY="; hash = "sha256-OKV8w5da9oZ1oSGbADVPCIkP9Y0MVLaQ3PXS3ZBLFXY=";
}; };
in in

View file

@ -1,5 +1,9 @@
{ config, pkgs, lib, ... }:
{ {
config,
pkgs,
lib,
...
}: {
hardware = { hardware = {
graphics = { graphics = {
enable = true; enable = true;
@ -49,5 +53,4 @@
# settingsSha256 = "sha256-ZpuVZybW6CFN/gz9rx+UJvQ715FZnAOYfHn5jt5Z2C8="; # settingsSha256 = "sha256-ZpuVZybW6CFN/gz9rx+UJvQ715FZnAOYfHn5jt5Z2C8=";
# usePersistenced = false; # usePersistenced = false;
#}; #};
} }

View file

@ -7,10 +7,8 @@
username, username,
inputs, inputs,
... ...
}: }: let
let in {
in
{
imports = imports =
[ [
#./modules/fastfetch #./modules/fastfetch
@ -33,7 +31,14 @@ in
# } # }
#) #)
++ lib.optional (builtins.pathExists ./homes/${username}) ( ++ lib.optional (builtins.pathExists ./homes/${username}) (
import ./homes/${username} { inherit username; inherit config; inherit pkgs; inherit lib; inherit inputs; inherit hwconfig; } import ./homes/${username} {
inherit username;
inherit config;
inherit pkgs;
inherit lib;
inherit inputs;
inherit hwconfig;
}
); );
# Home Manager needs a bit of information about you and the paths it should # Home Manager needs a bit of information about you and the paths it should
# manage. # manage.

View file

@ -1,6 +1,13 @@
{pkgs, hwconfig, ...}: {
let pkgs,
battery-path = "/sys/class/power_supply/${if hwconfig.hostname == "kylekrein-mac" then "macsmc-battery" else "BAT0"}"; hwconfig,
...
}: let
battery-path = "/sys/class/power_supply/${
if hwconfig.hostname == "kylekrein-mac"
then "macsmc-battery"
else "BAT0"
}";
get-battery-level = "${pkgs.writeShellScriptBin "get-battery-level" '' get-battery-level = "${pkgs.writeShellScriptBin "get-battery-level" ''
cat ${battery-path}/capacity 2>/dev/null || echo "N/A" cat ${battery-path}/capacity 2>/dev/null || echo "N/A"
''}/bin/get-battery-level"; ''}/bin/get-battery-level";
@ -63,8 +70,7 @@ else
echo "" echo ""
fi fi
''}/bin/get-remaining-time"; ''}/bin/get-remaining-time";
in in {
{
available = hwconfig.isLaptop; available = hwconfig.isLaptop;
icon = get-icon; icon = get-icon;
status = get-status; status = get-status;

View file

@ -1,7 +1,17 @@
{config, username, pkgs, lib, inputs, hwconfig, ...}: { {
imports = [ config,
username,
pkgs,
lib,
inputs,
hwconfig,
...
}: {
imports =
[
./git.nix ./git.nix
] ++ lib.optional (lib.strings.hasInfix "kylekrein" hwconfig.hostname) ( ]
++ lib.optional (lib.strings.hasInfix "kylekrein" hwconfig.hostname) (
import ./niri.nix { import ./niri.nix {
inherit pkgs; inherit pkgs;
inherit config; inherit config;

View file

@ -1,9 +1,16 @@
{ pkgs, lib, hwconfig, ... }:
let
profile-image = ./nixos-warbler.png;
battery-level = (import ./battery-status.nix {inherit pkgs; inherit hwconfig;}).labelPercent;
in
{ {
pkgs,
lib,
hwconfig,
...
}: let
profile-image = ./nixos-warbler.png;
battery-level =
(import ./battery-status.nix {
inherit pkgs;
inherit hwconfig;
}).labelPercent;
in {
programs.hyprlock = { programs.hyprlock = {
enable = true; enable = true;
settings = { settings = {
@ -52,7 +59,8 @@ in
halign = "center"; halign = "center";
valign = "center"; valign = "center";
}; };
label = [ label =
[
{ {
text = "$USER"; text = "$USER";
font_family = "Fira Code"; font_family = "Fira Code";
@ -77,16 +85,15 @@ in
halign = "right"; halign = "right";
valign = "bottom"; valign = "bottom";
} }
] ++ lib.optional (hwconfig.isLaptop) ( ]
{ ++ lib.optional (hwconfig.isLaptop) {
text = ''cmd[update:10000] ${battery-level}''; text = ''cmd[update:10000] ${battery-level}'';
font_family = "JetBrains Mono"; font_family = "JetBrains Mono";
font_size = 28; font_size = 28;
position = "20, 20"; position = "20, 20";
halign = "left"; halign = "left";
valign = "bottom"; valign = "bottom";
}); };
}; };
}; };
} }

View file

@ -1,8 +1,15 @@
#https://github.com/sodiboo/niri-flake/blob/main/default-config.kdl.nix #https://github.com/sodiboo/niri-flake/blob/main/default-config.kdl.nix
#https://github.com/sodiboo/niri-flake/blob/main/docs.md #https://github.com/sodiboo/niri-flake/blob/main/docs.md
#https://github.com/sodiboo/system/blob/main/niri.mod.nix #https://github.com/sodiboo/system/blob/main/niri.mod.nix
{config, pkgs, lib, inputs, hwconfig, username, ...}:
{ {
config,
pkgs,
lib,
inputs,
hwconfig,
username,
...
}: {
programs.fuzzel = { programs.fuzzel = {
enable = true; enable = true;
settings.main.terminal = "kitty"; settings.main.terminal = "kitty";
@ -14,7 +21,8 @@
./waybar ./waybar
./hyprlock.nix ./hyprlock.nix
]; ];
home.packages = with pkgs;[ home.packages = with pkgs;
[
nwg-drawer nwg-drawer
wlogout wlogout
brightnessctl brightnessctl
@ -24,7 +32,8 @@
libnotify libnotify
hyprlock hyprlock
networkmanagerapplet networkmanagerapplet
] ++ lib.optionals (hwconfig.hasTouchscreen) (with pkgs;[ ]
++ lib.optionals (hwconfig.hasTouchscreen) (with pkgs; [
wvkbd # https://github.com/jjsullivan5196/wvkbd wvkbd # https://github.com/jjsullivan5196/wvkbd
]); ]);
programs.niri = { programs.niri = {
@ -106,8 +115,7 @@
]; ];
default-column-width = {proportion = 1.0 / 2.0;}; default-column-width = {proportion = 1.0 / 2.0;};
}; };
binds = with config.lib.niri.actions; binds = with config.lib.niri.actions; let
let
sh = spawn "sh" "-c"; sh = spawn "sh" "-c";
emacs = action: sh "emacsclient -c --eval \"${action}\""; emacs = action: sh "emacsclient -c --eval \"${action}\"";
homedir = "/home/${username}/"; homedir = "/home/${username}/";
@ -159,7 +167,6 @@
"Mod+Shift+Ctrl+Left".action = move-column-to-monitor-left; "Mod+Shift+Ctrl+Left".action = move-column-to-monitor-left;
"Mod+Shift+Ctrl+Right".action = move-column-to-monitor-right; "Mod+Shift+Ctrl+Right".action = move-column-to-monitor-right;
"XF86AudioRaiseVolume".action = sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+"; "XF86AudioRaiseVolume".action = sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+";
"XF86AudioLowerVolume".action = sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; "XF86AudioLowerVolume".action = sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-";
"XF86AudioMute".action = sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; "XF86AudioMute".action = sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
@ -177,7 +184,13 @@
warp-mouse-to-focus.enable = true; warp-mouse-to-focus.enable = true;
keyboard = { keyboard = {
xkb.layout = "us, ru, de"; xkb.layout = "us, ru, de";
xkb.options = "grp:lctrl_toggle, ctrl:nocaps" + (if hwconfig.hostname == "kylekrein-mac" then ", altwin:swap_alt_win" else ""); xkb.options =
"grp:lctrl_toggle, ctrl:nocaps"
+ (
if hwconfig.hostname == "kylekrein-mac"
then ", altwin:swap_alt_win"
else ""
);
track-layout = "window"; track-layout = "window";
numlock = true; numlock = true;
}; };
@ -199,7 +212,8 @@
DISPLAY = ":0"; DISPLAY = ":0";
}; };
window-rules = [ window-rules = [
{ #active {
#active
matches = [ matches = [
{ {
is-active = true; is-active = true;
@ -207,7 +221,8 @@
]; ];
opacity = 1.0; opacity = 1.0;
} }
{ #inactive {
#inactive
matches = [ matches = [
{ {
is-active = false; is-active = false;
@ -215,7 +230,8 @@
]; ];
opacity = 1.0; opacity = 1.0;
} }
{ #opaque {
#opaque
matches = [ matches = [
{ {
app-id = "emacs"; app-id = "emacs";
@ -226,7 +242,8 @@
]; ];
opacity = 1.0; opacity = 1.0;
} }
{ #app-launcher {
#app-launcher
matches = [ matches = [
{ {
title = "emacs-run-launcher"; title = "emacs-run-launcher";
@ -235,7 +252,8 @@
open-floating = true; open-floating = true;
open-focused = true; open-focused = true;
} }
{ #PiP {
#PiP
matches = [ matches = [
{ {
title = "Picture-in-Picture"; title = "Picture-in-Picture";
@ -244,7 +262,11 @@
open-floating = true; open-floating = true;
open-focused = false; open-focused = false;
opacity = 1.0; opacity = 1.0;
default-floating-position = { x = 0; y = 0; relative-to = "top-right"; }; default-floating-position = {
x = 0;
y = 0;
relative-to = "top-right";
};
} }
]; ];
debug = lib.mkIf (hwconfig.hostname == "kylekrein-mac") { debug = lib.mkIf (hwconfig.hostname == "kylekrein-mac") {
@ -265,7 +287,8 @@
systemctl = "${pkgs.systemd}/bin/systemctl"; systemctl = "${pkgs.systemd}/bin/systemctl";
#locking-script = "${pkgs.swaylock}/bin/swaylock --daemonize"; #locking-script = "${pkgs.swaylock}/bin/swaylock --daemonize";
#unlocking-script = "pkill -SIGUSR1 swaylock"; #unlocking-script = "pkill -SIGUSR1 swaylock";
suspendScript = cmd: pkgs.writeShellScript "suspend-script" '' suspendScript = cmd:
pkgs.writeShellScript "suspend-script" ''
# check if any player has status "Playing" # check if any player has status "Playing"
${lib.getExe pkgs.playerctl} -a status | ${lib.getExe pkgs.ripgrep} Playing -q ${lib.getExe pkgs.playerctl} -a status | ${lib.getExe pkgs.ripgrep} Playing -q
# only suspend if nothing is playing # only suspend if nothing is playing
@ -282,7 +305,8 @@ in{
}; };
settings.listener = let settings.listener = let
secondary = "${systemctl} suspend"; secondary = "${systemctl} suspend";
in lib.mkIf (hwconfig.isLaptop) [ in
lib.mkIf (hwconfig.isLaptop) [
#{ #{
# timeout = 30; # timeout = 30;
# command = "pidof hyprlock && ${secondary}"; # command = "pidof hyprlock && ${secondary}";
@ -301,7 +325,6 @@ in{
mako = { mako = {
enable = false; enable = false;
settings = { settings = {
}; };
}; };
}; };

View file

@ -1,8 +1,14 @@
{ pkgs, lib, hwconfig, ... }:
let
battery = (import ../battery-status.nix {inherit pkgs; inherit hwconfig;});
in
{ {
pkgs,
lib,
hwconfig,
...
}: let
battery = import ../battery-status.nix {
inherit pkgs;
inherit hwconfig;
};
in {
programs.waybar = { programs.waybar = {
enable = true; enable = true;
systemd.enable = true; systemd.enable = true;
@ -14,7 +20,8 @@ in
#${builtins.readFile "${pkgs.waybar}/etc/xdg/waybar/style.css"} #${builtins.readFile "${pkgs.waybar}/etc/xdg/waybar/style.css"}
style = '' style = ''
${builtins.readFile ./waybarstyle.css}''; ${builtins.readFile ./waybarstyle.css}'';
settings = [{ settings = [
{
height = 36; height = 36;
layer = "top"; layer = "top";
position = "top"; position = "top";
@ -29,7 +36,8 @@ ${builtins.readFile ./waybarstyle.css}'';
"niri/workspaces" "niri/workspaces"
"niri/window" "niri/window"
]; ];
modules-right = lib.optional hwconfig.isLaptop "backlight" modules-right =
lib.optional hwconfig.isLaptop "backlight"
++ [ ++ [
"pulseaudio" "pulseaudio"
#"network" #"network"
@ -37,7 +45,8 @@ ${builtins.readFile ./waybarstyle.css}'';
"memory" "memory"
#"temperature" #"temperature"
"niri/language" "niri/language"
] ++ lib.optional battery.available "custom/battery" ]
++ lib.optional battery.available "custom/battery"
++ [ ++ [
"tray" "tray"
"custom/notification" "custom/notification"
@ -191,6 +200,7 @@ ${builtins.readFile ./waybarstyle.css}'';
fi fi
''; '';
}; };
}]; }
];
}; };
} }

View file

@ -10,11 +10,11 @@
inputs, inputs,
unstable-pkgs, unstable-pkgs,
... ...
}: }: {
{
programs.firefox.policies.Preferences."browser.startup.page" = lib.mkForce 1; programs.firefox.policies.Preferences."browser.startup.page" = lib.mkForce 1;
imports = [ imports =
[
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
inputs.stylix.nixosModules.stylix inputs.stylix.nixosModules.stylix
inputs.nixos-facter-modules.nixosModules.facter inputs.nixos-facter-modules.nixosModules.facter
@ -30,7 +30,8 @@
../../modules/sops ../../modules/sops
#../../modules/emacs #../../modules/emacs
./default.nix ./default.nix
] ++ lib.optional (hwconfig.useImpermanence) ./modules/impermanence; ]
++ lib.optional (hwconfig.useImpermanence) ./modules/impermanence;
facter.reportPath = ./facter.json; facter.reportPath = ./facter.json;
kylekrein.services.autoUpgrade = { kylekrein.services.autoUpgrade = {
enable = true; enable = true;
@ -39,7 +40,6 @@
user = "root"; user = "root";
}; };
boot = { boot = {
kernelPackages = lib.mkDefault pkgs.linuxPackages_6_14; kernelPackages = lib.mkDefault pkgs.linuxPackages_6_14;
loader = { loader = {
@ -62,7 +62,6 @@
#flatpak #flatpak
kk.services.flatpak.enable = true; kk.services.flatpak.enable = true;
services.flatpak.packages = [ services.flatpak.packages = [
]; ];
services.pipewire = { services.pipewire = {
@ -190,7 +189,8 @@
clean.extraArgs = "--keep-since 4d --keep 3"; clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/etc/nixos-config"; flake = "/etc/nixos-config";
}; };
fonts.packages = with unstable-pkgs; [ #TODO change to pkgs when 25.05 comes out fonts.packages = with unstable-pkgs; [
#TODO change to pkgs when 25.05 comes out
nerd-fonts.jetbrains-mono nerd-fonts.jetbrains-mono
font-awesome font-awesome
nerd-fonts.symbols-only nerd-fonts.symbols-only

View file

@ -5,8 +5,7 @@
}: { }: {
imports = [ imports = [
]; ];
environment.packages = with pkgs; environment.packages = with pkgs; [
[
neovim neovim
git git
fastfetch fastfetch

View file

@ -1,5 +1,9 @@
{ pkgs, config, lib, ... }:
{ {
pkgs,
config,
lib,
...
}: {
imports = [ imports = [
#../../modules/nixvim #../../modules/nixvim
../../homes/kylekrein/git.nix ../../homes/kylekrein/git.nix
@ -8,7 +12,8 @@
copyFont = let copyFont = let
font_src = "${pkgs.nerd-fonts.fira-code}/share/fonts/truetype/NerdFonts/FiraCode/FiraCodeNerdFont-Regular.ttf"; font_src = "${pkgs.nerd-fonts.fira-code}/share/fonts/truetype/NerdFonts/FiraCode/FiraCodeNerdFont-Regular.ttf";
font_dst = "${config.home.homeDirectory}/.termux/font.ttf"; font_dst = "${config.home.homeDirectory}/.termux/font.ttf";
in lib.hm.dag.entryAfter ["writeBoundary"] '' in
lib.hm.dag.entryAfter ["writeBoundary"] ''
( test ! -e "${font_dst}" || test $(sha1sum "${font_src}"|cut -d' ' -f1 ) != $(sha1sum "${font_dst}" |cut -d' ' -f1)) && $DRY_RUN_CMD install $VERBOSE_ARG -D "${font_src}" "${font_dst}" ( test ! -e "${font_dst}" || test $(sha1sum "${font_src}"|cut -d' ' -f1 ) != $(sha1sum "${font_dst}" |cut -d' ' -f1)) && $DRY_RUN_CMD install $VERBOSE_ARG -D "${font_src}" "${font_dst}"
''; '';
}; };

View file

@ -106,13 +106,16 @@
#forceSSL = true; #forceSSL = true;
#useACMEHost = "kylekrein.com"; #useACMEHost = "kylekrein.com";
#acmeRoot = "/var/lib/acme/challenges-kylekrein"; #acmeRoot = "/var/lib/acme/challenges-kylekrein";
}; in { };
"chat.kylekrein.com" = (SSL // { in {
"chat.kylekrein.com" =
SSL
// {
locations."/" = { locations."/" = {
proxyPass = "http://localhost:8080/"; proxyPass = "http://localhost:8080/";
proxyWebsockets = true; proxyWebsockets = true;
}; };
}); };
}; };
systemd.network.wait-online.enable = lib.mkForce false; systemd.network.wait-online.enable = lib.mkForce false;

View file

@ -1,11 +1,15 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = config,
[ (modulesPath + "/installer/scan/not-detected.nix") lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"];

View file

@ -1,11 +1,15 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = config,
[ (modulesPath + "/installer/scan/not-detected.nix") lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["usb_storage"]; boot.initrd.availableKernelModules = ["usb_storage"];
@ -18,8 +22,8 @@
fsType = "tmpfs"; fsType = "tmpfs";
options = ["defaults" "size=8G" "mode=755"]; options = ["defaults" "size=8G" "mode=755"];
}; };
fileSystems."/persist" = fileSystems."/persist" = {
{ device = "/dev/disk/by-label/nixos"; device = "/dev/disk/by-label/nixos";
fsType = "ext4"; fsType = "ext4";
depends = ["/"]; depends = ["/"];
neededForBoot = true; neededForBoot = true;
@ -34,8 +38,8 @@
options = ["bind"]; options = ["bind"];
depends = ["/persist"]; depends = ["/persist"];
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-label/EFI\\x20-\\x20NIXOS"; device = "/dev/disk/by-label/EFI\\x20-\\x20NIXOS";
fsType = "vfat"; fsType = "vfat";
#options = [ "fmask=0022" "dmask=0022" ]; #options = [ "fmask=0022" "dmask=0022" ];
}; };

View file

@ -3,16 +3,14 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
let
cfg = config.kk.services.conduwuit; cfg = config.kk.services.conduwuit;
defaultUser = "conduwuit"; defaultUser = "conduwuit";
defaultGroup = "conduwuit"; defaultGroup = "conduwuit";
format = pkgs.formats.toml {}; format = pkgs.formats.toml {};
configFile = format.generate "conduwuit.toml" cfg.settings; configFile = format.generate "conduwuit.toml" cfg.settings;
in in {
{
meta.maintainers = with lib.maintainers; [niklaskorz]; meta.maintainers = with lib.maintainers; [niklaskorz];
options.kk.services.conduwuit = { options.kk.services.conduwuit = {
enable = lib.mkEnableOption "conduwuit"; enable = lib.mkEnableOption "conduwuit";
@ -323,10 +321,10 @@ in
wantedBy = ["multi-user.target"]; wantedBy = ["multi-user.target"];
wants = ["network-online.target"]; wants = ["network-online.target"];
after = ["network-online.target"]; after = ["network-online.target"];
environment = lib.mkMerge ([ environment = lib.mkMerge [
{CONDUWUIT_CONFIG = configFile;} {CONDUWUIT_CONFIG = configFile;}
cfg.extraEnvironment cfg.extraEnvironment
]); ];
startLimitBurst = 5; startLimitBurst = 5;
startLimitIntervalSec = 60; startLimitIntervalSec = 60;
serviceConfig = { serviceConfig = {

View file

@ -67,7 +67,6 @@ users = {
networking.firewall.allowedUDPPorts = [3478 5349]; networking.firewall.allowedUDPPorts = [3478 5349];
#sops.secrets."services/conduwuit" = {mode = "0755";}; #sops.secrets."services/conduwuit" = {mode = "0755";};
sops.secrets."services/gitlab/dbPassword" = {owner = "gitlab";}; sops.secrets."services/gitlab/dbPassword" = {owner = "gitlab";};
sops.secrets."services/gitlab/rootPassword" = {owner = "gitlab";}; sops.secrets."services/gitlab/rootPassword" = {owner = "gitlab";};
sops.secrets."services/gitlab/secret" = {owner = "gitlab";}; sops.secrets."services/gitlab/secret" = {owner = "gitlab";};

View file

@ -1,8 +1,12 @@
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = config,
[ (modulesPath + "/profiles/qemu-guest.nix") lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"]; boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"];
@ -10,8 +14,8 @@
boot.kernelModules = []; boot.kernelModules = [];
boot.extraModulePackages = []; boot.extraModulePackages = [];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/4f7e141c-0fc7-415a-815d-944b36f93806"; device = "/dev/disk/by-uuid/4f7e141c-0fc7-415a-815d-944b36f93806";
fsType = "ext4"; fsType = "ext4";
}; };

View file

@ -2,7 +2,8 @@
# This file was populated at runtime with the networking # This file was populated at runtime with the networking
# details gathered from the active system. # details gathered from the active system.
networking = { networking = {
nameservers = [ "8.8.8.8" nameservers = [
"8.8.8.8"
]; ];
defaultGateway = "172.31.1.1"; defaultGateway = "172.31.1.1";
defaultGateway6 = { defaultGateway6 = {
@ -14,15 +15,30 @@
interfaces = { interfaces = {
eth0 = { eth0 = {
ipv4.addresses = [ ipv4.addresses = [
{ address="91.99.0.169"; prefixLength=32; } {
address = "91.99.0.169";
prefixLength = 32;
}
]; ];
ipv6.addresses = [ ipv6.addresses = [
{ address="fe80::9400:4ff:fe30:830e"; prefixLength=64; } {
address = "fe80::9400:4ff:fe30:830e";
prefixLength = 64;
}
];
ipv4.routes = [
{
address = "172.31.1.1";
prefixLength = 32;
}
];
ipv6.routes = [
{
address = "";
prefixLength = 128;
}
]; ];
ipv4.routes = [ { address = "172.31.1.1"; prefixLength = 32; } ];
ipv6.routes = [ { address = ""; prefixLength = 128; } ];
}; };
}; };
}; };
services.udev.extraRules = '' services.udev.extraRules = ''

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
services.desktopManager.cosmic.enable = true; services.desktopManager.cosmic.enable = true;
services.displayManager.cosmic-greeter.enable = true; services.displayManager.cosmic-greeter.enable = true;
} }

View file

@ -1,5 +1,4 @@
{ pkgs, ...}: {pkgs, ...}: {
{
programs.direnv = { programs.direnv = {
enable = true; enable = true;
nix-direnv.enable = true; nix-direnv.enable = true;

View file

@ -1,5 +1,10 @@
{ pkgs, inputs, hwconfig, unstable-pkgs, ... }:
{ {
pkgs,
inputs,
hwconfig,
unstable-pkgs,
...
}: {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
kdePackages.qtwayland kdePackages.qtwayland
kdePackages.qtsvg kdePackages.qtsvg

View file

@ -1,8 +1,7 @@
{ {
pkgs, pkgs,
emacs, emacs,
}: }: {
{
packages = with pkgs; [ packages = with pkgs; [
git git
gzip gzip

View file

@ -1,5 +1,8 @@
{ hwconfig, first-nixos-install, ... }:
{ {
hwconfig,
first-nixos-install,
...
}: {
programs.fastfetch = { programs.fastfetch = {
enable = true; enable = true;
@ -90,9 +93,14 @@
{ {
type = "command"; type = "command";
key = " "; key = " ";
text = #bash text =
#bash
'' ''
birth_install=${if hwconfig.useImpermanence then "${first-nixos-install}" else "$(stat -c %W /)"} birth_install=${
if hwconfig.useImpermanence
then "${first-nixos-install}"
else "$(stat -c %W /)"
}
current=$(date +%s) current=$(date +%s)
delta=$((current - birth_install)) delta=$((current - birth_install))
delta_days=$((delta / 86400)) delta_days=$((delta / 86400))

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
nixpkgs = { nixpkgs = {
overlays = [ overlays = [
(final: prev: { (final: prev: {
@ -25,6 +24,7 @@
--set MOZ_GMP_PATH "$out/gmp-widevinecdm/system-installed" --set MOZ_GMP_PATH "$out/gmp-widevinecdm/system-installed"
''; '';
}); });
})]; })
];
}; };
} }

View file

@ -1,6 +1,10 @@
{ lib, config, pkgs, hwconfig, ... }: {
lib,
let config,
pkgs,
hwconfig,
...
}: let
lock-false = { lock-false = {
Value = false; Value = false;
Status = "locked"; Status = "locked";
@ -9,8 +13,7 @@
Value = true; Value = true;
Status = "locked"; Status = "locked";
}; };
in in {
{
imports = [] ++ lib.optional (hwconfig.system == "aarch64-linux") ./aarch64-linux.nix; imports = [] ++ lib.optional (hwconfig.system == "aarch64-linux") ./aarch64-linux.nix;
programs = { programs = {
firefox = { firefox = {
@ -18,7 +21,9 @@
enable = true; enable = true;
languagePacks = ["de" "en-US" "ru"]; languagePacks = ["de" "en-US" "ru"];
/* ---- POLICIES ---- */ /*
---- POLICIES ----
*/
# Check about:policies#documentation for options. # Check about:policies#documentation for options.
policies = { policies = {
DisableTelemetry = true; DisableTelemetry = true;
@ -44,7 +49,9 @@
PasswordManagerEnabled = false; PasswordManagerEnabled = false;
NoDefaultBookmarks = true; NoDefaultBookmarks = true;
/* ---- EXTENSIONS ---- */ /*
---- EXTENSIONS ----
*/
# Check about:support for extension/add-on ID strings. # Check about:support for extension/add-on ID strings.
# Valid strings for installation_mode are "allowed", "blocked", # Valid strings for installation_mode are "allowed", "blocked",
# "force_installed" and "normal_installed". # "force_installed" and "normal_installed".
@ -88,12 +95,16 @@
install_url = "https://addons.mozilla.org/firefox/downloads/latest/adguard-adblocker/latest.xpi"; install_url = "https://addons.mozilla.org/firefox/downloads/latest/adguard-adblocker/latest.xpi";
installation_mode = "force_installed"; installation_mode = "force_installed";
}; };
}; };
/* ---- PREFERENCES ---- */ /*
---- PREFERENCES ----
*/
# Check about:config for options. # Check about:config for options.
Preferences = { Preferences = {
"browser.contentblocking.category" = { Value = "strict"; Status = "locked"; }; "browser.contentblocking.category" = {
Value = "strict";
Status = "locked";
};
"extensions.pocket.enabled" = lock-false; "extensions.pocket.enabled" = lock-false;
"extensions.screenshots.disabled" = lock-true; "extensions.screenshots.disabled" = lock-true;
"browser.startup.page" = 3; # restore session on startup "browser.startup.page" = 3; # restore session on startup

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
services.xserver = { services.xserver = {
enable = true; enable = true;
displayManager.gdm.enable = true; displayManager.gdm.enable = true;

View file

@ -1,5 +1,8 @@
{ pkgs, lib,... }:
{ {
pkgs,
lib,
...
}: {
programs.gnupg.agent = { programs.gnupg.agent = {
enable = true; enable = true;
settings = { settings = {
@ -7,7 +10,8 @@
}; };
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
(pass.withExtensions (exts: with exts;[ (pass.withExtensions (exts:
with exts; [
pass-otp pass-otp
pass-import pass-import
])) ]))

View file

@ -1,6 +1,13 @@
{pkgs, hwconfig, ...}: {
let pkgs,
battery-path = "/sys/class/power_supply/${if hwconfig.hostname == "kylekrein-mac" then "macsmc-battery" else "BAT0"}"; hwconfig,
...
}: let
battery-path = "/sys/class/power_supply/${
if hwconfig.hostname == "kylekrein-mac"
then "macsmc-battery"
else "BAT0"
}";
get-battery-level = "${pkgs.writeShellScriptBin "get-battery-level" '' get-battery-level = "${pkgs.writeShellScriptBin "get-battery-level" ''
cat ${battery-path}/capacity 2>/dev/null || echo "N/A" cat ${battery-path}/capacity 2>/dev/null || echo "N/A"
''}/bin/get-battery-level"; ''}/bin/get-battery-level";
@ -63,8 +70,7 @@ else
echo "" echo ""
fi fi
''}/bin/get-remaining-time"; ''}/bin/get-remaining-time";
in in {
{
available = hwconfig.isLaptop; available = hwconfig.isLaptop;
icon = get-icon; icon = get-icon;
status = get-status; status = get-status;

View file

@ -1,5 +1,10 @@
{ pkgs, inputs, hwconfig, unstable-pkgs, ... }:
{ {
pkgs,
inputs,
hwconfig,
unstable-pkgs,
...
}: {
stylix = { stylix = {
enable = true; enable = true;
image = "${./wallpaper.jpg}"; image = "${./wallpaper.jpg}";
@ -129,6 +134,4 @@
#platformTheme = "qt5ct"; #platformTheme = "qt5ct";
#style = "kvantum"; #style = "kvantum";
# }; # };
} }

View file

@ -4,8 +4,7 @@
lib, lib,
hwconfig, hwconfig,
... ...
}: }: {
{
imports = [ imports = [
(import ./hyprland.nix { (import ./hyprland.nix {
inherit pkgs; inherit pkgs;

View file

@ -1,20 +1,25 @@
{ pkgs, lib, hwconfig, ... }: {
let pkgs,
lib,
hwconfig,
...
}: let
suspendScript = pkgs.writeShellScript "suspend-script" '' suspendScript = pkgs.writeShellScript "suspend-script" ''
# check if any player has status "Playing" # check if any player has status "Playing"
${lib.getExe pkgs.playerctl} -a status | ${lib.getExe pkgs.ripgrep} Playing -q ${lib.getExe pkgs.playerctl} -a status | ${lib.getExe pkgs.ripgrep} Playing -q
# only suspend if nothing is playing # only suspend if nothing is playing
if [ $? == 1 ]; then if [ $? == 1 ]; then
${if hwconfig.isLaptop then "${pkgs.systemd}/bin/systemctl suspend" else "loginctl lock-session"} ${
if hwconfig.isLaptop
then "${pkgs.systemd}/bin/systemctl suspend"
else "loginctl lock-session"
}
fi fi
''; '';
in in {
{
services.hypridle = { services.hypridle = {
enable = true; enable = true;
settings = { settings = {
general = { general = {
lock_cmd = "pidof hyprlock || hyprlock"; lock_cmd = "pidof hyprlock || hyprlock";
before_sleep_cmd = "pidof hyprlock || loginctl lock-session"; # lock before suspend. before_sleep_cmd = "pidof hyprlock || loginctl lock-session"; # lock before suspend.
@ -23,7 +28,6 @@ general = {
}; };
listener = [ listener = [
#{ #{
# on-resume="brightnessctl -r"; # monitor backlight restore. # on-resume="brightnessctl -r"; # monitor backlight restore.
# on-timeout="brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor. # on-timeout="brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
@ -57,9 +61,6 @@ listener = [
# timeout=420; # timeout=420;
#} #}
]; ];
}; };
}; };
} }

View file

@ -132,7 +132,13 @@ in {
}; };
input = { input = {
kb_layout = "us, ru"; kb_layout = "us, ru";
kb_options = "grp:lctrl_toggle, ctrl:nocaps" + (if hwconfig.hostname == "kylekrein-mac" then ", altwin:swap_alt_win" else ""); # "ctrl:nocaps, grp:toggle" kb_options =
"grp:lctrl_toggle, ctrl:nocaps"
+ (
if hwconfig.hostname == "kylekrein-mac"
then ", altwin:swap_alt_win"
else ""
); # "ctrl:nocaps, grp:toggle"
touchpad = { touchpad = {
natural_scroll = true; natural_scroll = true;
@ -173,7 +179,8 @@ in {
allow_tearing = false; allow_tearing = false;
layout = "dwindle"; layout = "dwindle";
}; };
render = lib.mkIf (hwconfig.system == "aarch64-linux") { # Explicit sync breaks asahi driver https://github.com/hyprwm/Hyprland/issues/8158 render = lib.mkIf (hwconfig.system == "aarch64-linux") {
# Explicit sync breaks asahi driver https://github.com/hyprwm/Hyprland/issues/8158
explicit_sync = 0; explicit_sync = 0;
}; };

View file

@ -1,9 +1,16 @@
{ pkgs, lib, hwconfig, ... }:
let
profile-image = ./profile-image.png;
battery-level = (import ./battery-status.nix {inherit pkgs; inherit hwconfig;}).labelPercent;
in
{ {
pkgs,
lib,
hwconfig,
...
}: let
profile-image = ./profile-image.png;
battery-level =
(import ./battery-status.nix {
inherit pkgs;
inherit hwconfig;
}).labelPercent;
in {
programs.hyprlock = { programs.hyprlock = {
enable = true; enable = true;
settings = { settings = {
@ -51,7 +58,8 @@ in
halign = "center"; halign = "center";
valign = "center"; valign = "center";
}; };
label = [ label =
[
{ {
text = "$USER"; text = "$USER";
font_family = "Fira Code"; font_family = "Fira Code";
@ -76,16 +84,15 @@ in
halign = "right"; halign = "right";
valign = "bottom"; valign = "bottom";
} }
] ++ lib.optional (hwconfig.isLaptop) ( ]
{ ++ lib.optional (hwconfig.isLaptop) {
text = ''cmd[update:10000] ${battery-level}''; text = ''cmd[update:10000] ${battery-level}'';
font_family = "JetBrains Mono"; font_family = "JetBrains Mono";
font_size = 28; font_size = 28;
position = "20, 20"; position = "20, 20";
halign = "left"; halign = "left";
valign = "bottom"; valign = "bottom";
}); };
}; };
}; };
} }

View file

@ -1,8 +1,14 @@
{ pkgs, lib, hwconfig, ... }:
let
battery = (import ./battery-status.nix {inherit pkgs; inherit hwconfig;});
in
{ {
pkgs,
lib,
hwconfig,
...
}: let
battery = import ./battery-status.nix {
inherit pkgs;
inherit hwconfig;
};
in {
programs.waybar = { programs.waybar = {
enable = true; enable = true;
#systemd.enable = true; #systemd.enable = true;
@ -19,7 +25,8 @@ in
font-size: 15px; font-size: 15px;
} }
''; '';
settings = [{ settings = [
{
height = 36; height = 36;
layer = "top"; layer = "top";
position = "top"; position = "top";
@ -32,7 +39,8 @@ in
"hyprland/workspaces" "hyprland/workspaces"
# "hyprland/window" # "hyprland/window"
]; ];
modules-right = lib.optional hwconfig.isLaptop "backlight" modules-right =
lib.optional hwconfig.isLaptop "backlight"
++ [ ++ [
"pulseaudio" "pulseaudio"
#"network" #"network"
@ -40,7 +48,8 @@ in
"memory" "memory"
#"temperature" #"temperature"
"hyprland/language" "hyprland/language"
] ++ lib.optional battery.available "custom/battery" ]
++ lib.optional battery.available "custom/battery"
++ [ ++ [
"tray" "tray"
"custom/notification" "custom/notification"
@ -184,6 +193,7 @@ in
fi fi
''; '';
}; };
}]; }
];
}; };
} }

View file

@ -1,7 +1,6 @@
{ ... }: {...}: let
let folder = ".config/kando"; folder = ".config/kando";
in in {
{
home.file = { home.file = {
#"${folder}/config.json".source = ./config.json; #"${folder}/config.json".source = ./config.json;
"${folder}/menus.json".source = ./menus.json; "${folder}/menus.json".source = ./menus.json;

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
services.xserver.enable = true; services.xserver.enable = true;
services.desktopManager.plasma6.enable = true; services.desktopManager.plasma6.enable = true;

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
virtualisation = { virtualisation = {
libvirtd = { libvirtd = {
enable = true; enable = true;

View file

@ -1,5 +1,4 @@
{ username, ... }: {username, ...}: {
{
users.users.${username}.extraGroups = ["libvirtd"]; users.users.${username}.extraGroups = ["libvirtd"];
home-manager.users.${username} = { home-manager.users.${username} = {
dconf.settings = { dconf.settings = {

View file

@ -1,5 +1,8 @@
{ pkgs, inputs, ...}:
{ {
pkgs,
inputs,
...
}: {
nixpkgs.overlays = [ nixpkgs.overlays = [
inputs.niri-flake.overlays.niri inputs.niri-flake.overlays.niri
]; ];

View file

@ -3,13 +3,10 @@
config, config,
lib, lib,
... ...
}: }: let
let
cfg = config.kylekrein.services.autoUpgrade; cfg = config.kylekrein.services.autoUpgrade;
script = ./nixos-upgrade-script.sh; script = ./nixos-upgrade-script.sh;
in in {
{
options = { options = {
kylekrein.services.autoUpgrade = { kylekrein.services.autoUpgrade = {
enable = lib.mkEnableOption "Enables automatic system updates."; enable = lib.mkEnableOption "Enables automatic system updates.";
@ -69,10 +66,26 @@ in
unitConfig.RequiresMountsFor = cfg.configDir; unitConfig.RequiresMountsFor = cfg.configDir;
script = script =
"${script} --operation ${cfg.operation} " "${script} --operation ${cfg.operation} "
+ (if (cfg.configDir != "") then "--flake ${cfg.configDir} " else "") + (
+ (if (cfg.user != "") then "--user ${cfg.user} " else "") if (cfg.configDir != "")
+ (if (cfg.pushUpdates) then "--update " else "") then "--flake ${cfg.configDir} "
+ (if (cfg.extraFlags != "") then cfg.extraFlags else ""); else ""
)
+ (
if (cfg.user != "")
then "--user ${cfg.user} "
else ""
)
+ (
if (cfg.pushUpdates)
then "--update "
else ""
)
+ (
if (cfg.extraFlags != "")
then cfg.extraFlags
else ""
);
}; };
timers."nixos-upgrade" = { timers."nixos-upgrade" = {
wants = ["network-online.target"]; wants = ["network-online.target"];

View file

@ -1,8 +1,16 @@
{ config, pkgs, inputs, lib, hwconfig, ... }:
let
keyPath = (if hwconfig.useImpermanence then "/persist/sops/age/keys.txt" else "/var/lib/sops/age/keys.txt");
in
{ {
config,
pkgs,
inputs,
lib,
hwconfig,
...
}: let
keyPath =
if hwconfig.useImpermanence
then "/persist/sops/age/keys.txt"
else "/var/lib/sops/age/keys.txt";
in {
environment.systemPackages = with pkgs; [sops]; environment.systemPackages = with pkgs; [sops];
sops.defaultSopsFile = ./secrets/secrets.yaml; sops.defaultSopsFile = ./secrets/secrets.yaml;
sops.defaultSopsFormat = "yaml"; sops.defaultSopsFormat = "yaml";

View file

@ -7,7 +7,10 @@
... ...
}: let }: let
cfg = config.kk.steam; cfg = config.kk.steam;
containerPath = if hwconfig.useImpermanence then "/persist/home/containers/steam" else "/var/containers/steam"; containerPath =
if hwconfig.useImpermanence
then "/persist/home/containers/steam"
else "/var/containers/steam";
containerName = "fedora-steam"; containerName = "fedora-steam";
in { in {
options.kk.steam = { options.kk.steam = {
@ -62,10 +65,8 @@ env -u SUDO_USER ${pkgs.distrobox}/bin/distrobox-enter "${containerName}" -- sud
env -u SUDO_USER ${pkgs.distrobox}/bin/distrobox enter "${containerName}" -- distrobox-export --app steam env -u SUDO_USER ${pkgs.distrobox}/bin/distrobox enter "${containerName}" -- distrobox-export --app steam
'') '')
]; ];
} }
else else {
{
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
unzip unzip
wget wget
@ -85,7 +86,8 @@ env -u SUDO_USER ${pkgs.distrobox}/bin/distrobox-enter "${containerName}" -- sud
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
package = pkgs.steam.override { package = pkgs.steam.override {
extraPkgs = pkgs: with pkgs; [ extraPkgs = pkgs:
with pkgs; [
xorg.libXcursor xorg.libXcursor
xorg.libXi xorg.libXi
xorg.libXinerama xorg.libXinerama

View file

@ -1,7 +1,14 @@
{ pkgs, config, lib, hwconfig, inputs, first-nixos-install, ... }:
let username = "andrej";
in
{ {
pkgs,
config,
lib,
hwconfig,
inputs,
first-nixos-install,
...
}: let
username = "andrej";
in {
imports = [ imports = [
]; ];
users.users.${username} = { users.users.${username} = {
@ -20,6 +27,17 @@ in
}; };
}; };
home-manager.users."${username}" = import ../../home.nix { inherit lib; inherit username; inherit inputs; inherit first-nixos-install; inherit hwconfig; inherit config; inherit pkgs; }; home-manager.users."${username}" = import ../../home.nix {
systemd.tmpfiles.rules = (if hwconfig.useImpermanence then ["d /persist/home/${username} 0700 ${username} users -"] else []); # /persist/home/<user> created, owned by that user inherit lib;
inherit username;
inherit inputs;
inherit first-nixos-install;
inherit hwconfig;
inherit config;
inherit pkgs;
};
systemd.tmpfiles.rules =
if hwconfig.useImpermanence
then ["d /persist/home/${username} 0700 ${username} users -"]
else []; # /persist/home/<user> created, owned by that user
} }

View file

@ -1,7 +1,14 @@
{ pkgs, config, lib, hwconfig, inputs, first-nixos-install, ... }:
let username = "dima";
in
{ {
pkgs,
config,
lib,
hwconfig,
inputs,
first-nixos-install,
...
}: let
username = "dima";
in {
imports = [ imports = [
]; ];
users.users.${username} = { users.users.${username} = {
@ -15,10 +22,20 @@ in
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILIc/J6YxwWKajJ923/PZ2fcgLgWZdVMcZQ4oZZ+2hwn dima@dragonarch" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILIc/J6YxwWKajJ923/PZ2fcgLgWZdVMcZQ4oZZ+2hwn dima@dragonarch"
]; ];
}; };
programs.ssh.forwardX11 = true; programs.ssh.forwardX11 = true;
home-manager.users."${username}" = import ../../home.nix { inherit lib; inherit username; inherit inputs; inherit first-nixos-install; inherit hwconfig; inherit config; inherit pkgs; }; home-manager.users."${username}" = import ../../home.nix {
systemd.tmpfiles.rules = (if hwconfig.useImpermanence then ["d /persist/home/${username} 0700 ${username} users -"] else []); # /persist/home/<user> created, owned by that user inherit lib;
inherit username;
inherit inputs;
inherit first-nixos-install;
inherit hwconfig;
inherit config;
inherit pkgs;
};
systemd.tmpfiles.rules =
if hwconfig.useImpermanence
then ["d /persist/home/${username} 0700 ${username} users -"]
else []; # /persist/home/<user> created, owned by that user
} }

View file

@ -1,7 +1,14 @@
{ pkgs, config, lib, hwconfig, inputs, first-nixos-install, ... }:
let username = "tania";
in
{ {
pkgs,
config,
lib,
hwconfig,
inputs,
first-nixos-install,
...
}: let
username = "tania";
in {
imports = [ imports = [
]; ];
users.users.${username} = { users.users.${username} = {
@ -19,6 +26,17 @@ in
}; };
}; };
home-manager.users."${username}" = import ../../home.nix { inherit lib; inherit username; inherit inputs; inherit first-nixos-install; inherit hwconfig; inherit config; inherit pkgs; }; home-manager.users."${username}" = import ../../home.nix {
systemd.tmpfiles.rules = (if hwconfig.useImpermanence then ["d /persist/home/${username} 0700 ${username} users -"] else []); # /persist/home/<user> created, owned by that user inherit lib;
inherit username;
inherit inputs;
inherit first-nixos-install;
inherit hwconfig;
inherit config;
inherit pkgs;
};
systemd.tmpfiles.rules =
if hwconfig.useImpermanence
then ["d /persist/home/${username} 0700 ${username} users -"]
else []; # /persist/home/<user> created, owned by that user
} }

View file

@ -7,16 +7,17 @@
inputs, inputs,
unstable-pkgs, unstable-pkgs,
... ...
}: }: {
{ imports =
imports = [ [
./modules/firefox ./modules/firefox
./modules/flatpak ./modules/flatpak
./modules/emacs ./modules/emacs
./modules/gnupg ./modules/gnupg
./modules/direnv ./modules/direnv
./hosts/${hwconfig.hostname} ./hosts/${hwconfig.hostname}
] ++ lib.optional (hwconfig.useImpermanence) ./modules/impermanence; ]
++ lib.optional (hwconfig.useImpermanence) ./modules/impermanence;
networking.hostName = hwconfig.hostname; networking.hostName = hwconfig.hostname;
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
@ -29,7 +30,6 @@
#flatpak #flatpak
#kk.services.flatpak.enable = hwconfig.system != "aarch64-linux"; #kk.services.flatpak.enable = hwconfig.system != "aarch64-linux";
services.flatpak.packages = [ services.flatpak.packages = [
]; ];
# Enable common container config files in /etc/containers # Enable common container config files in /etc/containers