auto-cpufreq added

This commit is contained in:
foglar 2024-12-27 10:32:32 +01:00
parent 34d77cf53b
commit d99d544813
4 changed files with 71 additions and 40 deletions

View File

@ -33,6 +33,26 @@
"type": "github"
}
},
"auto-cpufreq": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1733175750,
"narHash": "sha256-tczSI0dnsitstia/uVt7FyGQbtuW8lMhhMYj0TRSAT4=",
"owner": "AdnanHodzic",
"repo": "auto-cpufreq",
"rev": "4dae1d4b59bedc1d57118a9eb704c2e1cde5f83c",
"type": "github"
},
"original": {
"owner": "AdnanHodzic",
"repo": "auto-cpufreq",
"type": "github"
}
},
"base16": {
"inputs": {
"fromYaml": "fromYaml"
@ -641,6 +661,7 @@
},
"root": {
"inputs": {
"auto-cpufreq": "auto-cpufreq",
"firefox-addons": "firefox-addons",
"home-manager": "home-manager",
"hyprland": "hyprland",

View File

@ -45,6 +45,11 @@
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
auto-cpufreq = {
url = "github:AdnanHodzic/auto-cpufreq";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
@ -98,6 +103,7 @@
inputs.stylix.nixosModules.stylix
inputs.nix-ld.nixosModules.nix-ld
inputs.sops-nix.nixosModules.sops
inputs.auto-cpufreq.nixosModules.default
];
};
ginoza = nixpkgs.lib.nixosSystem {

View File

@ -8,9 +8,13 @@
program.yubikey = {
enable = lib.mkEnableOption "Enable YubiKey authentication";
};
program.yubikey = {
lock-on-remove = lib.mkEnableOption "Lock the session when the YubiKey is removed";
};
};
config = lib.mkIf config.program.yubikey.enable {
config = lib.mkMerge [
(lib.mkIf config.program.yubikey.enable {
environment.systemPackages = with pkgs; [
yubioath-flutter
yubikey-manager
@ -42,7 +46,8 @@
enable = true;
enableSSHSupport = true;
};
})
(lib.mkIf config.program.yubikey.lock-on-remove {
services.udev.extraRules = ''
ACTION=="remove",\
ENV{ID_BUS}=="usb",\
@ -51,5 +56,6 @@
ENV{ID_VENDOR}=="Yubico",\
RUN+="${pkgs.systemd}/bin/loginctl lock-sessions"
'';
};
})
];
}

View File

@ -60,8 +60,6 @@
};
services.udisks2.enable = true;
services.power-profiles-daemon.enable = true;
security = {
polkit.enable = true;
pam.services.hyprlock = {};