Compare commits

...

44 Commits

Author SHA1 Message Date
82f1a5b92d Flake update, return vivaldi from nixpkgs 2025-12-05 01:32:30 +03:00
cb686c36ec Add yamdex-cloud cli, update home-manager to 25.11 2025-12-02 20:42:12 +03:00
9864dbd348 Switch to 25.11 2025-12-01 02:47:23 +03:00
76389b1902 Add niri module, flake update 2025-12-01 02:43:59 +03:00
658a645080 Use flatpacked vivaldi, flake update 2025-11-23 10:20:20 +03:00
b1f5a9fd6b Flake update 2025-11-17 14:03:48 +03:00
0316fb2b6c Use clever yubilock 2025-11-16 02:29:56 +03:00
b4afe2581e Add appimage support and fuse package 2025-11-16 00:34:23 +03:00
c50b7355ee Flake update 2025-11-14 00:03:59 +03:00
517b9b7957 Yubilock conflict with keepassxc+yubikey 2025-11-14 00:03:49 +03:00
8a99abdca9 Enable ipfs web ui 2025-11-11 23:43:49 +03:00
528c1b4063 Flake update 2025-11-11 23:09:14 +03:00
72d5e80d44 Add cups package for lpr 2025-11-11 23:08:07 +03:00
c319570c30 Add yubilock quirk and enable kubo service 2025-11-09 12:28:22 +03:00
06e871c578 Flake update 2025-11-08 17:36:47 +03:00
6dd62ba2f5 Add git include 2025-11-07 09:16:17 +03:00
d732a2ff44 Flake update 2025-11-06 16:04:01 +03:00
0bb28c7644 Cleanup 2025-11-06 14:06:07 +03:00
3da1db7631 Flake update, cleanup 2025-11-05 17:24:23 +03:00
f59e7aa05c Packages refactoring 2025-11-04 23:04:22 +03:00
41d99f6f33 Steamos role refactoring 2025-11-04 22:58:08 +03:00
bb59ec35e6 Enable u2f auth 2025-11-04 22:57:47 +03:00
b66a6cb1cd Flake update 2025-11-04 01:11:10 +03:00
636847dd30 Add firefox, fix ssh config, flake update 2025-11-02 14:28:39 +03:00
ce07587897 Flake update 2025-10-23 10:26:49 +03:00
9d8a66facd Flake update, use goland and rust from stable, add kdenlive for fenix@fenixpc 2025-10-14 18:02:42 +03:00
9b71a9e223 Flake update, update oom config, disable avidemux and remove gnome specialization (due to cmake) 2025-10-07 18:30:06 +03:00
35924eebcf Flake update 2025-10-07 18:14:21 +03:00
50acaee3ef Flake update 2025-10-05 19:43:34 +03:00
1cf25bbb1d Flake update 2025-09-25 13:27:43 +03:00
1576279891 Flake update 2025-09-21 11:42:30 +03:00
ed23362da1 Flake update 2025-09-19 18:27:46 +03:00
33658c20eb Refactoring and fixing 2025-09-16 19:51:36 +03:00
c5320ce825 Enable prgrams.ssh, add software 2025-09-12 07:39:36 +03:00
9af0b2d108 Use obsidian hm program 2025-09-10 08:47:57 +03:00
6932e9e184 Flake update 2025-09-10 08:47:24 +03:00
11c2e2fa9f Calibre-web workaround 2025-09-10 08:47:13 +03:00
355e3c9ef9 Add inkscape 2025-09-09 22:39:29 +03:00
cc4b113642 Add pt certificates 2025-09-09 17:44:45 +03:00
464feaff9c Try to disable sound cards auto suspend 2025-09-08 12:35:03 +03:00
f4402561a9 Add rust development 2025-09-04 11:53:13 +03:00
7301ecb77e Join users group 2025-09-03 22:12:34 +03:00
02200a1a7d Add calibre and transmission client 2025-09-03 22:12:17 +03:00
6e02ce3b15 Add steam-devices-udev-rules for steam quirk 2025-09-02 22:59:31 +03:00
25 changed files with 615 additions and 132 deletions

86
flake.lock generated
View File

@@ -28,15 +28,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1756683562, "lastModified": 1764866045,
"narHash": "sha256-3fcIqwm1u+rF3kkgUYYEIcLrs93+Pi+a6AwiEAxdP5g=", "narHash": "sha256-0GsEtXV9OquDQ1VclQfP16cU5VZh7NEVIOjSH4UaJuM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "fccb44df77266a3891939f35197f538dace3442f", "rev": "f63d0fe9d81d36e5fc95497217a72e02b8b7bcab",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-25.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@@ -75,13 +76,28 @@
"type": "github" "type": "github"
} }
}, },
"nix-flatpak": {
"locked": {
"lastModified": 1754777568,
"narHash": "sha256-0bBqT+3XncgF8F03RFAamw9vdf0VmaDoIJLTGkjfQZs=",
"owner": "gmodena",
"repo": "nix-flatpak",
"rev": "62f636b87ef6050760a8cb325cadb90674d1e23e",
"type": "github"
},
"original": {
"owner": "gmodena",
"repo": "nix-flatpak",
"type": "github"
}
},
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1756750488, "lastModified": 1764440730,
"narHash": "sha256-e4ZAu2sjOtGpvbdS5zo+Va5FUUkAnizl4wb0/JlIL2I=", "narHash": "sha256-ZlJTNLUKQRANlLDomuRWLBCH5792x+6XUJ4YdFRjtO4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "47eb4856cfd01eaeaa7bb5944a0f27db8fb9b94a", "rev": "9154f4569b6cdfd3c595851a6ba51bfaa472d9f3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -93,11 +109,43 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1756542300, "lastModified": 1764677808,
"narHash": "sha256-tlOn88coG5fzdyqz6R93SQL5Gpq+m/DsWpekNFhqPQk=", "narHash": "sha256-H3lC7knbXOBrHI9hITQ7modLuX20mYJVhZORL5ioms0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d7600c775f877cd87b4f5a831c28aa94137377aa", "rev": "1aab89277eb2d87823d5b69bae631a2496cff57a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-master": {
"locked": {
"lastModified": 1764884164,
"narHash": "sha256-JVBdqcz6O7noXRImADjFh+J7+14wigl+Vkt1hHTr56M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "953a2e2892dc8e6b9623e233853239984c11dd7c",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1764667669,
"narHash": "sha256-7WUCZfmqLAssbDqwg9cUDAXrSoXN79eEEq17qhTNM/Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "418468ac9527e799809c900eda37cbff999199b6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -107,22 +155,6 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-stable": {
"locked": {
"lastModified": 1756617294,
"narHash": "sha256-aGnd4AHIYCWQKChAkHPpX+YYCt7pA6y2LFFA/s8q0wQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b4c2c57c31e68544982226d07e4719a2d86302a8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"photocatalog": { "photocatalog": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -177,9 +209,11 @@
"inputs": { "inputs": {
"disko": "disko", "disko": "disko",
"home-manager": "home-manager", "home-manager": "home-manager",
"nix-flatpak": "nix-flatpak",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable", "nixpkgs-master": "nixpkgs-master",
"nixpkgs-unstable": "nixpkgs-unstable",
"photocatalog": "photocatalog", "photocatalog": "photocatalog",
"raspberry-pi-nix": "raspberry-pi-nix" "raspberry-pi-nix": "raspberry-pi-nix"
} }

View File

@@ -2,10 +2,11 @@
description = "Fxnet system configurations"; description = "Fxnet system configurations";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.05"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
photocatalog = { photocatalog = {
@@ -23,13 +24,17 @@
nixos-hardware = { nixos-hardware = {
url = "github:NixOS/nixos-hardware/master"; url = "github:NixOS/nixos-hardware/master";
}; };
nix-flatpak = {
url = "github:gmodena/nix-flatpak";
};
}; };
outputs = outputs =
{ {
self, self,
nixpkgs, nixpkgs,
nixpkgs-stable, nixpkgs-unstable,
nixpkgs-master,
... ...
}@inputs: }@inputs:
let let
@@ -51,9 +56,15 @@
config.allowUnfree = true; config.allowUnfree = true;
} }
); );
pkgsStableSettings = pkgsUnstableSettings =
system: system:
import nixpkgs-stable { import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
pkgsMasterSettings =
system:
import nixpkgs-master {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
}; };
@@ -78,15 +89,18 @@
home.stateVersion = osConfig.system.stateVersion; home.stateVersion = osConfig.system.stateVersion;
} }
) )
inputs.nix-flatpak.homeManagerModules.nix-flatpak
]; ];
extraSpecialArgs = { extraSpecialArgs = {
inherit inputs; inherit inputs;
pkgsStable = pkgsStableSettings pkgs.system; pkgsUnstable = pkgsUnstableSettings pkgs.system;
pkgsMaster = pkgsMasterSettings pkgs.system;
hosts = hosts; hosts = hosts;
}; };
}; };
} }
) )
inputs.nix-flatpak.nixosModules.nix-flatpak
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
inputs.photocatalog.nixosModules.photocatalog inputs.photocatalog.nixosModules.photocatalog
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
@@ -106,7 +120,8 @@
system = host.system; system = host.system;
specialArgs = { specialArgs = {
inherit inputs; inherit inputs;
pkgsStable = pkgsStableSettings host.system; pkgsUnstable = pkgsUnstableSettings host.system;
pkgsMaster = pkgsMasterSettings host.system;
hosts = hosts; hosts = hosts;
quirks = (quirks: (import ./quirks { inherit quirks; })); quirks = (quirks: (import ./quirks { inherit quirks; }));
}; };

View File

@@ -62,6 +62,7 @@ in
"wheel" "wheel"
"input" "input"
"audio" "audio"
"users"
]; ];
}); });

View File

@@ -15,6 +15,8 @@ in
username = userName; username = userName;
homeDirectory = lib.mkForce "/home/${userName}"; homeDirectory = lib.mkForce "/home/${userName}";
packages = with pkgs; [ packages = with pkgs; [
spotify
# Games # Games
prismlauncher prismlauncher
(bottles.override { removeWarningPopup = true; }) (bottles.override { removeWarningPopup = true; })
@@ -36,6 +38,8 @@ in
vscode.enable = true; vscode.enable = true;
gpg.enable = true; gpg.enable = true;
neovim.enable = true; neovim.enable = true;
obsidian.enable = true;
ssh.enable = true;
vivaldi = { vivaldi = {
enable = true; enable = true;

View File

@@ -15,6 +15,7 @@ in
quirks [ quirks [
"development" "development"
"steam" "steam"
# "yubilock"
] ]
); );
@@ -34,7 +35,7 @@ in
}; };
}; };
systemd.oomd.extraConfig.DefaultMemoryPressureLimit = "15%"; systemd.oomd.settings.OOM.DefaultMemoryPressureLimit = "15%";
services = { services = {
printing.ricoh.enable = true; printing.ricoh.enable = true;
@@ -45,11 +46,16 @@ in
enable = true; enable = true;
user = "fenix"; user = "fenix";
}; };
lact.enable = true;
}; };
systemd.services.calibre-web.serviceConfig.environment = lib.mkForce "";
systemd.services.calibre-web.environment.CACHE_DIR = "/var/cache/calibre-web";
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
microcode-amd microcode-amd
openvpn openvpn
cups
]; ];
users = { users = {
@@ -69,6 +75,9 @@ in
"wheel" "wheel"
"input" "input"
"audio" "audio"
"users"
"gamemode"
config.services.kubo.group
]; ];
}); });
groups = { groups = {
@@ -97,4 +106,44 @@ in
kwallet.enable = true; kwallet.enable = true;
}); });
}; };
programs = {
niri = {
enable = false;
};
gamemode = {
enable = true;
settings = {
general = {
renice = 10;
# blacklist = "vlc,firefox";
# whitelist = "game1,game2";
};
cpu = {
governor = "performance";
boost = "auto";
};
gpu = {
amd_performance_level = "high";
apply_gpu_optimizations = 1;
per_process_gpu_clocks = 1;
};
supervisor = {
# killlist = "tracker-miner-fs,tracker-store";
};
custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
};
};
};
};
hardware.graphics = {
extraPackages = with pkgs; [
libva
vulkan-tools
];
};
} }

View File

@@ -2,32 +2,50 @@
pkgs, pkgs,
lib, lib,
config, config,
osConfig,
... ...
}: }:
let let
userName = "fenix"; userName = "fenix";
in in
{ {
pt.enable = true; pt.enable = true;
home = { home = {
username = userName; username = userName;
homeDirectory = lib.mkForce "/home/${userName}"; homeDirectory = lib.mkForce "/home/${userName}";
packages = with pkgs; [ packages = with pkgs; [
calibre
obsidian
transmission_4-qt6
kdePackages.kdenlive
kdePackages.plasma-sdk
yandex-music
krusader
avidemux
gimp
krita
krita-plugin-gmic
inkscape
# Games # Games
steam steam
prismlauncher prismlauncher
(bottles.override { removeWarningPopup = true; }) (bottles.override { removeWarningPopup = true; })
warzone2100 # warzone2100
sauerbraten sauerbraten
#Development #Development
yandex-cloud
devenv devenv
direnv direnv
yaml-language-server yaml-language-server
plantuml plantuml
jetbrains.goland jetbrains.goland
jetbrains.rust-rover
rustup
gcc
gnumake gnumake
protobuf protobuf
]; ];
@@ -39,10 +57,23 @@ in
vscode.enable = true; vscode.enable = true;
gpg.enable = true; gpg.enable = true;
neovim.enable = true; neovim.enable = true;
ssh.enable = true;
vivaldi = { vivaldi = {
enable = true; enable = true;
}; };
firefox = {
enable = true;
languagePacks = [
"ru"
];
nativeMessagingHosts =
[ ]
++ lib.optionals (osConfig.services.desktopManager.plasma6.enable) [
pkgs.kdePackages.plasma-browser-integration
];
};
direnv = { direnv = {
enableZshIntegration = config.programs.zsh.enable; enableZshIntegration = config.programs.zsh.enable;
}; };
@@ -58,5 +89,9 @@ in
settings.folders.PhotoArchive.enabled = true; settings.folders.PhotoArchive.enabled = true;
settings.folders.books.enabled = true; settings.folders.books.enabled = true;
}; };
yubilock = {
enable = true;
autoRestore = true;
};
}; };
} }

25
modules/hm/flatpak.nix Normal file
View File

@@ -0,0 +1,25 @@
{
osConfig,
config,
lib,
...
}:
{
services.flatpak = lib.mkIf (osConfig.services.flatpak.enable) {
enable = true;
uninstallUnmanaged = true;
remotes = [
{
name = "flathub";
location = "https://flathub.org/repo/flathub.flatpakrepo";
}
];
packages = lib.mkIf (config.programs.vivaldi.flatpak) [
{
appId = "com.vivaldi.Vivaldi";
origin = "flathub";
}
];
};
}

View File

@@ -33,6 +33,22 @@
signByDefault = lib.mkDefault true; signByDefault = lib.mkDefault true;
key = lib.mkDefault "DD89337AFABD013FDD57A0F133445FB510D677DF"; key = lib.mkDefault "DD89337AFABD013FDD57A0F133445FB510D677DF";
}; };
includes = [
{
condition = "gitdir:~/dev/gofonox-org/";
contents = {
user = {
name = "Gofonox";
email = "gofonox@yandex.ru";
signingkey = "468075AB62C2BF67B3435BD18E49915B4743363E";
};
commit = {
gpgsign = true;
};
};
}
];
}; };
}; };
} }

28
modules/hm/niri.nix Normal file
View File

@@ -0,0 +1,28 @@
{
pkgs,
osConfig,
lib,
...
}:
let
enable = osConfig.programs.niri.enable;
in
{
programs = lib.mkIf (enable) {
alacritty.enable = true; # Super+T in the default setting (terminal)
fuzzel.enable = true; # Super+D in the default setting (app launcher)
swaylock.enable = true; # Super+Alt+L in the default setting (screen locker)
waybar.enable = true; # launch on startup in the default setting (bar)
};
services = lib.mkIf (enable) {
mako.enable = true; # notification daemon
swayidle.enable = true; # idle management daemon
};
home.packages =
with pkgs;
lib.mkIf (enable) [
swaybg
];
}

View File

@@ -72,6 +72,9 @@ in
enabled = true; enabled = true;
label = "PTDev"; label = "PTDev";
path = devFolder; path = devFolder;
devices = [
"nas"
];
}; };
}; };
}; };

View File

@@ -2,12 +2,13 @@
{ {
programs = { programs = {
ssh = { ssh = {
enableDefaultConfig = false;
matchBlocks = { matchBlocks = {
"router" = { "router" = {
user = "admin"; user = "admin";
hostname = "192.168.1.1"; hostname = "192.168.1.1";
port = 2222; port = 2222;
controlPersist = "10m"; controlPersist = "no";
addKeysToAgent = "9h"; addKeysToAgent = "9h";
compression = false; compression = false;
@@ -16,8 +17,15 @@
serverAliveCountMax = 3; serverAliveCountMax = 3;
hashKnownHosts = false; hashKnownHosts = false;
userKnownHostsFile = "~/.ssh/known_hosts"; userKnownHostsFile = "~/.ssh/known_hosts";
controlMaster = "auto"; controlMaster = "no";
controlPath = "~/.ssh/master-%r@%n:%p"; controlPath = "none";
extraOptions = {
KexAlgorithms = "curve25519-sha256@libssh.org,diffie-hellman-group14-sha256";
WarnWeakCrypto = "no";
ServerAliveInterval = "30";
ServerAliveCountMax = "4";
};
}; };
"aur" = { "aur" = {
hostname = "aur.archlinux.org"; hostname = "aur.archlinux.org";

View File

@@ -19,6 +19,10 @@
enabled = lib.mkDefault true; enabled = lib.mkDefault true;
label = "Sync"; label = "Sync";
path = "~/Sync"; path = "~/Sync";
devices = [
"nas"
"s25"
];
}; };
"Documents" = { "Documents" = {
id = "ikwrq-ahv5a"; id = "ikwrq-ahv5a";
@@ -26,6 +30,9 @@
enabled = lib.mkDefault false; enabled = lib.mkDefault false;
label = "Documents"; label = "Documents";
path = "~/Documents"; path = "~/Documents";
devices = [
"nas"
];
}; };
"Music" = { "Music" = {
id = "6ytyt-ngvta"; id = "6ytyt-ngvta";
@@ -33,6 +40,9 @@
enabled = lib.mkDefault false; enabled = lib.mkDefault false;
label = "Music"; label = "Music";
path = "~/Music"; path = "~/Music";
devices = [
"nas"
];
}; };
"Obsidian" = { "Obsidian" = {
id = "hyeaf-ygups"; id = "hyeaf-ygups";
@@ -40,6 +50,10 @@
enabled = lib.mkDefault false; enabled = lib.mkDefault false;
label = "Obsidian"; label = "Obsidian";
path = "~/Obsidian"; path = "~/Obsidian";
devices = [
"nas"
"s25"
];
}; };
"Camera S25" = { "Camera S25" = {
id = "sm-s938b_9wbf-фото"; id = "sm-s938b_9wbf-фото";
@@ -47,14 +61,21 @@
type = "receiveonly"; type = "receiveonly";
label = "Camera S25"; label = "Camera S25";
path = "~/Photos/S25"; path = "~/Photos/S25";
devices = [
"nas"
"s25"
];
}; };
"PhotoArchive" = { "PhotoArchive" = {
id = "6detn-xjbco"; id = "6detn-xjbco";
type = "receiveonly"; type = "sendreceive";
enabled = lib.mkDefault false; enabled = lib.mkDefault false;
label = "PhotoArchive"; label = "PhotoArchive";
path = "~/Photos/archive"; path = "~/Photos/archive";
ignorePerms = true; ignorePerms = true;
devices = [
"nas"
];
}; };
"books" = { "books" = {
id = "6st45-t9jej"; id = "6st45-t9jej";
@@ -62,6 +83,9 @@
enabled = lib.mkDefault false; enabled = lib.mkDefault false;
label = "Books"; label = "Books";
path = "/mnt/hdd/Books"; path = "/mnt/hdd/Books";
devices = [
"nas"
];
}; };
}; };

View File

@@ -7,19 +7,25 @@
}: }:
let let
conf = config.programs.vivaldi; conf = config.programs.vivaldi;
vivaldiCMD = if conf.flatpak then "flatpak run com.vivaldi.Vivaldi" else "vivaldi";
vivaldiIcon = if conf.flatpak then "com.vivaldi.Vivaldi" else "vivaldi";
in in
{ {
config = lib.mkIf conf.enable { options = {
programs.vivaldi.flatpak = lib.mkEnableOption "Use flatpak verion of Vivaldi";
};
config = lib.mkIf (conf.enable || conf.flatpak) {
home.file.vivaldiKDEScript = { home.file.vivaldiKDEScript = {
target = ".local/bin/vivaldi-kde.sh"; target = ".local/bin/vivaldi-kde.sh";
text = '' text = ''
#!/bin/sh #!/bin/sh
vivaldi --profile-directory=$(qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.ActivityName $(qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.CurrentActivity)) "$@" ${vivaldiCMD} --profile-directory=$(qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.ActivityName $(qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.CurrentActivity)) "$@"
''; '';
executable = true; executable = true;
}; };
programs.vivaldi = { programs.vivaldi = lib.mkIf (conf.enable) {
nativeMessagingHosts = nativeMessagingHosts =
[ ] [ ]
++ lib.optionals (osConfig.services.desktopManager.plasma6.enable) [ ++ lib.optionals (osConfig.services.desktopManager.plasma6.enable) [
@@ -46,7 +52,7 @@ in
exec = "${config.home.file.vivaldiKDEScript.source} --new-window"; exec = "${config.home.file.vivaldiKDEScript.source} --new-window";
}; };
}; };
icon = "vivaldi"; icon = "${vivaldiIcon}";
startupNotify = true; startupNotify = true;
categories = [ categories = [
"Application" "Application"

167
modules/hm/yubilock.nix Normal file
View File

@@ -0,0 +1,167 @@
# Stealed from https://github.com/guttermonk/yubilock
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.yubilock;
# Script paths - users should copy scripts to their ~/.config/waybar/scripts/
yubilockScript = pkgs.writeShellScript "yubilock" ''
STATE_FILE="$HOME/.cache/yubilock-state"
LOG_FILE="$HOME/.cache/yubilock.log"
PID_FILE="$HOME/.cache/yubilock.pid"
# Function to check if a YubiKey is currently plugged in
check_yubikey() {
if ${pkgs.usbutils}/bin/lsusb | ${pkgs.gnugrep}/bin/grep -i "yubikey" > /dev/null; then
return 0 # device is present
else
return 1 # device is not present
fi
}
# Function to lock the screen
lock_screen() {
# Using loginctl for systemd-based systems
${pkgs.systemd}/bin/loginctl lock-session
echo "Screen locked at $(date)" >> "$LOG_FILE"
}
# Create state file if it doesn't exist
if [ ! -f "$STATE_FILE" ]; then
echo "off" > "$STATE_FILE"
fi
# Record PID for later termination
echo "$$" > "$PID_FILE"
# Main monitoring loop
echo "YubiKey monitoring started at $(date)" >> "$LOG_FILE"
while true; do
# Check if monitoring is still enabled
if [ "$(cat "$STATE_FILE")" != "on" ]; then
echo "YubiKey monitoring stopped at $(date)" >> "$LOG_FILE"
exit 0
fi
if check_yubikey; then
echo "YubiKey detected at $(date)" >> "$LOG_FILE"
# Wait until the YubiKey is removed
while check_yubikey && [ "$(cat "$STATE_FILE")" = "on" ]; do
sleep 1
done
# If we exited because service was disabled, exit gracefully
if [ "$(cat "$STATE_FILE")" != "on" ]; then
echo "YubiKey monitoring stopped at $(date)" >> "$LOG_FILE"
exit 0
fi
echo "YubiKey removed at $(date)" >> "$LOG_FILE"
lock_screen
else
echo "No YubiKey detected. Checking again in 10 seconds..." >> "$LOG_FILE"
# Check less frequently to reduce system load
sleep 10
fi
done
'';
yubilockRestoreScript = pkgs.writeShellScript "yubilock-restore" ''
STATE_FILE="$HOME/.cache/yubilock-state"
LOG_FILE="$HOME/.cache/yubilock-restore.log"
echo "[$(date)] Checking yubilock state on login" >> "$LOG_FILE"
# Create state file if it doesn't exist
if [ ! -f "$STATE_FILE" ]; then
echo "off" > "$STATE_FILE"
echo "[$(date)] No state file found, defaulting to off" >> "$LOG_FILE"
exit 0
fi
# Read the saved state
saved_state=$(cat "$STATE_FILE")
echo "[$(date)] Saved state: $saved_state" >> "$LOG_FILE"
# If it was enabled before, re-enable it
if [ "$saved_state" = "on" ]; then
if ! ${pkgs.systemd}/bin/systemctl --user is-active yubilock.service > /dev/null 2>&1; then
echo "[$(date)] Restoring yubilock service" >> "$LOG_FILE"
${pkgs.systemd}/bin/systemctl --user start yubilock.service
echo "[$(date)] Yubilock service restored" >> "$LOG_FILE"
else
echo "[$(date)] Yubilock service already running" >> "$LOG_FILE"
fi
fi
'';
in
{
options.services.yubilock = {
enable = mkEnableOption "YubiKey screen lock monitor";
autoRestore = mkOption {
type = types.bool;
default = true;
description = ''
Automatically restore yubilock state on login.
If enabled, the yubilock service will be restarted on login
if it was running when you last logged out.
'';
};
};
config = mkIf cfg.enable {
# Systemd user service for yubilock
systemd.user.services.yubilock = {
Unit = {
Description = "YubiKey lock screen monitor";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = "${yubilockScript}";
Restart = "on-failure";
RestartSec = "5s";
# Ensure state persists
ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p %h/.cache";
# Clean state on stop
ExecStopPost = "${pkgs.bash}/bin/bash -c 'echo off > %h/.cache/yubilock-state'";
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
# Systemd user service to restore yubilock state on login
systemd.user.services.yubilock-restore = mkIf cfg.autoRestore {
Unit = {
Description = "Restore YubiKey monitor state on login";
After = [ "graphical-session.target" ];
};
Service = {
Type = "oneshot";
ExecStart = "${yubilockRestoreScript}";
RemainAfterExit = false;
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
# Ensure required packages are available
home.packages = with pkgs; [
usbutils # for lsusb command
];
};
}

View File

@@ -1,5 +1,13 @@
{ lib, ... }:
{ {
lib,
pkgs,
config,
...
}:
{
home.packages = lib.mkIf config.programs.zsh.enable (with pkgs; [ zsh-powerlevel10k ]);
programs.zsh = { programs.zsh = {
autosuggestion = { autosuggestion = {
enable = true; enable = true;
@@ -48,11 +56,15 @@
"aliases" "aliases"
"alias-finder" "alias-finder"
"rsync" "rsync"
"z"
]; ];
theme = lib.mkDefault "agnoster"; # theme = lib.mkDefault "powerlevel10k/powerlevel10k";
}; };
initContent = '' initContent = ''
source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme
source ~/.p10k.zsh
zstyle ':omz:plugins:alias-finder' autoload yes zstyle ':omz:plugins:alias-finder' autoload yes
zstyle ':omz:plugins:alias-finder' longer no zstyle ':omz:plugins:alias-finder' longer no
zstyle ':omz:plugins:alias-finder' exact yes zstyle ':omz:plugins:alias-finder' exact yes

View File

@@ -1,10 +1,10 @@
{ pkgsStable, lib, ... }: { pkgs, lib, ... }:
{ {
services = { services = {
calibre-web = { calibre-web = {
listen.port = lib.mkDefault 8091; listen.port = lib.mkDefault 8091;
listen.ip = lib.mkDefault "0.0.0.0"; listen.ip = lib.mkDefault "0.0.0.0";
package = pkgsStable.calibre-web; package = pkgs.calibre-web;
options = { options = {
enableBookUploading = true; enableBookUploading = true;
enableBookConversion = true; enableBookConversion = true;

78
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MS9wa2lfcm9vdC9jYTA6BgNVHR8EMzAx
MC+gLaArhilodHRwOi8vcGtpLnB0c2VjdXJpdHkuY29tL3YxL3BraV9yb290L2Ny
bDANBgkqhkiG9w0BAQsFAAOCAgEAm5Z+vg6nBg2oR/1ukDARctEIvZj5ntaE92bh
laFd+nLFU3javVIDhWQCbgpXw0bemT009HfF2yulFFiIonEYcmEdF2xrmWOI7mko
Z/dTw8dGGSoW3e+XZwpdIbTQNPGGp7EpSh6USu/kp15Q9lgvUAcbfCk3i9i3ENYi
m05WHbQQem+sKJwsfpcv+xsDNUVNNvXKWg6SA78r6Wv1bNr4AalwPlbCkZompsDW
ayLUGietrbMiUdEi/Tdfo9LwpEKAlJkGSJSKO/lGIUkGe8iJotGX8nfjt9kY2AfE
NLCVku4imJwJPNGw+tfTyeiNjsU7Gx+jkTrUAk6FmkR9n7u6cnRXO4rAreftbDBr
pV9YSGFcTEWSjQeF2Y1kZuxtPmS0m9gdstcrWtPdbpP6qWYjhl6T5vs4So4A9xzt
0F4DHiQb4UGV+LUK98Gbx9mTVZOZLckW2xU27kyvGqLaTRXCrU/ij9q46nJTGicl
ZPmtQ45pMlmIjp5xv9vQ5d7ULjb/B683SJGeKrk8HyUUFY/ZCP3QNN9z1oD2oD/w
T8qiuPJE+vh07y92SUDEQKaEh2AXbjptzZJH57TKlEC932HaJZcvTdEfaGH6Emzu
7DjYj0+4SuTN629SwU7DwEvrWtZXTCwg7ubpQRr+Bv4A1k/zNLAWk8PXmh5cE/ki
CnRHY8o=
-----END CERTIFICATE-----
''
];
in
{
security.pki.certificates = ptCerts;
}

View File

@@ -25,6 +25,7 @@
"nix-command" "nix-command"
"flakes" "flakes"
]; ];
download-buffer-size = 524288000;
log-lines = 30; log-lines = 30;
min-free = mkDefault "${toString (5 * 1024 * 1024 * 1024)}"; min-free = mkDefault "${toString (5 * 1024 * 1024 * 1024)}";
max-free = mkDefault "${toString (10 * 1024 * 1024 * 1024)}"; max-free = mkDefault "${toString (10 * 1024 * 1024 * 1024)}";

View File

@@ -5,10 +5,5 @@
type = lib.types.int; type = lib.types.int;
default = 10; default = 10;
}; };
hm = lib.mkOption {
type = lib.types.attrsOf lib.types.anything;
default = { };
};
}; };
} }

View File

@@ -1,4 +1,4 @@
{ ... }: { pkgs, ... }:
{ {
imports = [ imports = [
./32bit.nix ./32bit.nix
@@ -7,4 +7,8 @@
hardware = { hardware = {
steam-hardware.enable = true; steam-hardware.enable = true;
}; };
environment.systemPackages = [
pkgs.steam-devices-udev-rules
];
} }

View File

@@ -10,7 +10,7 @@
enable = true; enable = true;
enableUserSlices = lib.mkDefault true; enableUserSlices = lib.mkDefault true;
enableSystemSlice = lib.mkDefault true; enableSystemSlice = lib.mkDefault true;
extraConfig = { settings.OOM = {
DefaultMemoryPressureDurationSec = lib.mkDefault "20s"; DefaultMemoryPressureDurationSec = lib.mkDefault "20s";
DefaultMemoryPressureLimit = lib.mkDefault "50%"; DefaultMemoryPressureLimit = lib.mkDefault "50%";
}; };
@@ -39,6 +39,16 @@
}; };
services = { services = {
kubo = {
enable = lib.mkDefault true;
enableGC = lib.mkDefault true;
settings = {
Addresses = {
API = "/ip4/127.0.0.1/tcp/5001";
};
};
};
openssh = { openssh = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
settings = { settings = {

View File

@@ -82,8 +82,13 @@ in
}; };
pam = { pam = {
yubico.enable = true; u2f = {
yubico.mode = "challenge-response"; enable = true;
settings = {
cue = true;
};
};
services.sddm.u2fAuth = true;
}; };
}; };
@@ -100,7 +105,22 @@ in
}; };
pipewire = { pipewire = {
wireplumber.enable = true; wireplumber = {
enable = true;
extraConfig."99-disable-suspend" = {
"monitor.alsa.rules" = [
{
matches = [
{ "node.name" = "~alsa_input.*"; }
{ "node.name" = "~alsa_output.*"; }
];
actions.update-props = {
"session.suspend-timeout-seconds" = 0;
};
}
];
};
};
audio.enable = true; audio.enable = true;
enable = true; enable = true;
@@ -114,7 +134,9 @@ in
btrfs.autoScrub.interval = "weekly"; btrfs.autoScrub.interval = "weekly";
flatpak.enable = true; flatpak = {
enable = true;
};
printing = { printing = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
@@ -145,20 +167,17 @@ in
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
mesa mesa
wl-clipboard
steam-run steam-run
pam_u2f
fuse
obsidian
telegram-desktop telegram-desktop
keepassxc keepassxc
gimp
mpv mpv
ffmpeg ffmpeg
yt-dlp yt-dlp
avidemux
krita
krita-plugin-gmic
# onlyoffice-desktopeditors
libreoffice-qt-fresh libreoffice-qt-fresh
thunderbird-latest thunderbird-latest
@@ -168,6 +187,11 @@ in
]; ];
programs = { programs = {
appimage = {
enable = true;
binfmt = true;
};
nix-ld = { nix-ld = {
enable = true; enable = true;
libraries = [ libraries = [

View File

@@ -12,6 +12,10 @@
type = lib.types.bool; type = lib.types.bool;
default = false; default = false;
}; };
displayName = lib.mkOption {
type = lib.types.str;
default = "DP-1";
};
}; };
}; };
@@ -31,7 +35,6 @@
services.xserver.enable = false; services.xserver.enable = false;
# Современные видеодрайверы
hardware = { hardware = {
graphics = { graphics = {
enable = true; enable = true;
@@ -53,11 +56,12 @@
enable = true; enable = true;
gamescopeSession.enable = true; gamescopeSession.enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server dedicatedServer.openFirewall = true;
localNetworkGameTransfers.openFirewall = true; localNetworkGameTransfers.openFirewall = true;
}; };
}; };
services.getty.autologinUser = "steam"; services.getty.autologinUser = "steam";
environment = { environment = {
loginShellInit = '' loginShellInit = ''
@@ -69,6 +73,7 @@
home.file."gs.sh" = { home.file."gs.sh" = {
text = '' text = ''
#!/usr/bin/env bash #!/usr/bin/env bash
set -xeuo pipefail set -xeuo pipefail
gamescopeArgs=( gamescopeArgs=(
@@ -76,7 +81,7 @@
--hdr-enabled --hdr-enabled
--rt --rt
--steam --steam
-S DP-1 -S ${config.steamos.displayName}
) )
steamArgs=( steamArgs=(
-pipewire-dmabuf -pipewire-dmabuf

View File

@@ -21,7 +21,7 @@
spectacle spectacle
elisa elisa
dolphin-plugins dolphin-plugins
xwaylandvideobridge kgpg
]; ];
programs = { programs = {

View File

@@ -1,61 +0,0 @@
{ pkgs, lib, ... }:
{
specialisation.gnome.configuration = {
system.nixos.tags = [ "gnome" ];
services = {
displayManager = {
defaultSession = lib.mkForce "gnome";
sddm.enable = lib.mkForce false;
gdm = {
enable = true;
wayland = true;
autoSuspend = true;
banner = ''
Оставь надежду
Всяк сюда входящий
'';
};
};
desktopManager = {
plasma6.enable = lib.mkForce false;
gnome.enable = true;
};
hardware.bolt.enable = true;
gnome = {
core-os-services.enable = true;
gnome-keyring.enable = true;
gnome-settings-daemon.enable = true;
core-shell.enable = true;
};
};
programs.evolution = {
enable = true;
plugins = [ pkgs.evolution-ews ];
};
environment = {
variables = {
XCURSOR_THEME = "Adwaita";
};
gnome.excludePackages = with pkgs; [
geary
epiphany
gnome-calendar
];
};
xdg.portal = {
config.common = {
default = lib.mkForce [
"gnome"
];
};
extraPortals = lib.mkForce [
pkgs.xdg-desktop-portal-gnome
];
};
};
}