Modularize and clean up NixOS configuration

This commit is contained in:
Narrator 2025-12-08 17:56:11 +01:00
parent 33332afe63
commit b2dfb94ec9
Signed by: Narrator
SSH key fingerprint: SHA256:vVtKn4QxRw+5lhRxGf6CeaA4Dgnsl7DMlQEzwkcMPV0
27 changed files with 2262 additions and 334 deletions

View file

@ -0,0 +1 @@
3.11

0
direnvs/python/README.md Normal file
View file

6
direnvs/python/main.py Normal file
View file

@ -0,0 +1,6 @@
def main():
print("Hello from python!")
if __name__ == "__main__":
main()

View file

@ -0,0 +1,9 @@
[project]
name = "python"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"jupyter>=1.1.1",
]

1654
direnvs/python/uv.lock generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -18,42 +18,32 @@
};
outputs = { self, nixpkgs, home-manager, flake-utils, nixvim, nix-ai-tools } @ inputs: {
# Reusable modules
homeManagerModules.copilot-cli = import ./modules/home-manager/copilot-cli.nix;
nixosModules.auto-upgrade = import ./modules/nixos/auto-upgrade.nix;
homeManagerModules.copilot-cli = { lib, pkgs, config, inputs, ... }: {
options.programs.copilot-cli.enable = lib.mkEnableOption "";
config = lib.mkIf config.programs.copilot-cli.enable {
home.packages = [
(
inputs.nix-ai-tools.packages.${pkgs.system}.copilot-cli or
(inputs.nixpkgs.legacyPackages.${pkgs.system}.fetchgit {
url = "github:numtide/nix-ai-tools";
ref = "main";
}).packages.${pkgs.system}.copilot-cli
)
];
};
};
# Host configurations
nixosConfigurations.nxs = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/nxs/configuration.nix
./hosts/nxs/hardware-configuration.nix
self.nixosModules.auto-upgrade
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs; };
home-manager.users.narrator = import ./hosts/nxs/home.nix;
system.autoUpgrade = {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs; };
users.narrator = import ./hosts/nxs/home.nix;
sharedModules = [
self.homeManagerModules.copilot-cli
];
};
nixos.autoUpgrade = {
enable = true;
flake = self.outPath; # <<< here use self.outPath directly, NOT inputs.self
flags = [ "-L" ];
dates = "02:00";
randomizedDelaySec = "45min";
operation = "switch";
flakePath = self.outPath;
};
}
];

View file

@ -1,136 +1,47 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
fileSystems."/home" = {
device = "/dev/disk/by-uuid/31dbc3a8-dfdc-4177-8d3e-2b6e294e7daf";
fsType = "btrfs";
};
swapDevices = [
{ device = "/dev/disk/by-uuid/f9da6980-510f-4cce-bff5-50a791346c07"; }
imports = [
./hardware-configuration.nix
./modules/nixos/boot.nix
./modules/nixos/hardware.nix
./modules/nixos/desktop.nix
./modules/nixos/power-management.nix
];
# System settings
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nixpkgs.config.allowUnfree = true;
# Use the systemd-boot EFI boot loader.
#boot.loader.systemd-boot.enable = true;
#boot.loader.efi.canTouchEfiVariables = true;
boot.loader.grub.enable = true;
boot.loader.grub.efiSupport = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.loader.grub.device = "nodev";
boot.loader.grub.useOSProber = true;
boot.loader.grub.configurationLimit = 5;
boot.loader.efi.canTouchEfiVariables = true;
#boot.loader.grub.efiInstallAsRemovable = true;
boot.loader.grub.extraConfig = ''
GRUB_DISABLE_OS_PROBER=false
GRUB_TERMINAL_OUTPUT=console
'';
system.stateVersion = "25.05";
boot.loader.grub.gfxmodeBios = "1280x720"; # for BIOS, or
boot.loader.grub.gfxmodeEfi = "1280x720"; # for EFI
boot.loader.grub.gfxpayloadBios = "keep";
# Use latest kernel.
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelParams = [ "nvidia-drm.modeset=1" "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ];
networking.hostName = "nxs"; # Define your hostname.
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Networking
networking = {
hostName = "nxs";
networkmanager.enable = true;
firewall.enable = true;
};
# Set your time zone.
# Localization
time.timeZone = "Europe/Rome";
virtualisation.docker.enable = true;
# optional but sane:
virtualisation.docker.enableOnBoot = true;
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
# i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };
# Enable the X11 windowing system.
services.xserver = {
# Virtualization
virtualisation.docker = {
enable = true;
libinput = {
enable = true;
touchpad = {
naturalScrolling = true;
tapping = true;
disableWhileTyping = true;
clickMethod = "clickfinger";
};
};
displayManager.lightdm = {
enable = true;
autoLogin.enable = true;
autoLogin.user = "narrator";
};
windowManager.i3.enable = true;
videoDrivers = [ "amdgpu" "nvidia" ];
deviceSection = ''
BusID "PCI:1:0:0"
Driver "nvidia"
'';
enableOnBoot = true;
};
# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
# services.pulseaudio.enable = true;
# OR
security.rtkit.enable = true;
services.pipewire = {
alsa.enable = true;
enable = true;
pulse.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
# Users
programs.fish.enable = true;
users.users.narrator = {
isNormalUser = true;
extraGroups = [ "wheel" "docker" ]; # Enable sudo for the user.
extraGroups = [ "wheel" "docker" ];
shell = pkgs.fish;
packages = with pkgs; [
tree
];
packages = with pkgs; [ tree ];
};
programs.firefox.enable = true;
# List packages installed in system profile.
# You can use https://search.nixos.org/ to find more packages (and options).
# System packages
environment.systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
vim
gnupg
wget
cryptsetup
@ -147,115 +58,24 @@
awesome
blueman
];
fonts.packages = with pkgs; [
nerd-fonts.fira-code
nerd-fonts.droid-sans-mono
nerd-fonts.symbols-only
];
services.logind = {
lidSwitch = "ignore";
lidSwitchDocked = "ignore";
lidSwitchExternalPower = "lock";
extraConfig = ''
IdleAction=ignore
HandleSuspendKey=ignore
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore
SuspendKeyIgnoreInhibited=yes
LidSwitchIgnoreInhibited=yes
HandlePowerKey=poweroff
HandleSuspendKey=hibernate
'';
# Services
services = {
openssh.enable = true;
timesyncd.enable = true;
pcscd.enable = true;
};
systemd.sleep.extraConfig = ''
AllowSuspend=no
AllowHibernation=no
AllowHybridSleep=no
AllowSuspendThenHibernate=no
'';
# firewall bc duh
networking.firewall.enable = true;
documentation.man.generateCaches = false;
# time sync
services.timesyncd.enable = true;
# bluetooth
hardware.bluetooth.enable = true;
services.blueman.enable = true;
# enable printing
services.printing.enable = true;
# enable openssh for remote access
services.openssh.enable = true;
programs.ssh.startAgent = true;
# Programs
programs = {
firefox.enable = true;
ssh.startAgent = true;
gnupg.agent.enable = true;
};
# Security
security.sudo.wheelNeedsPassword = false;
system.stateVersion = "25.05"; # Did you read the comment?
# GnuPG
programs.gnupg.agent = {
enable = true;
};
services.pcscd.enable = true;
systemd.services."getty@tty2".enable = true;
systemd.services."getty@tty3".enable = true;
hardware.graphics = {
enable = true;
};
# Load nvidia driver for Xorg and Wayland
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
#powerManagement.finegrained = true;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
open = true;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
# SSH config:
};
hardware.nvidia.forceFullCompositionPipeline = true;
systemd.services = {
systemd-suspend.environment.SYSTEMD_SLEEP_FREEZE_USER_SESSIONS = "false";
systemd-hibernate.environment.SYSTEMD_SLEEP_FREEZE_USER_SESSIONS = "false"; # if u care
};
hardware.nvidia.prime = {
offload.enable = true;
amdgpuBusId = "PCI:7:0:0";
nvidiaBusId = "PCI:1:0:0";
#amdgpuBusId = "PCI:54:0:0"; # If you have an AMD iGPU
};
# Documentation
documentation.man.generateCaches = false;
}

View file

@ -0,0 +1,261 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
fileSystems."/home" = {
device = "/dev/disk/by-uuid/31dbc3a8-dfdc-4177-8d3e-2b6e294e7daf";
fsType = "btrfs";
};
swapDevices = [
{ device = "/dev/disk/by-uuid/f9da6980-510f-4cce-bff5-50a791346c07"; }
];
nixpkgs.config.allowUnfree = true;
# Use the systemd-boot EFI boot loader.
#boot.loader.systemd-boot.enable = true;
#boot.loader.efi.canTouchEfiVariables = true;
boot.loader.grub.enable = true;
boot.loader.grub.efiSupport = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.loader.grub.device = "nodev";
boot.loader.grub.useOSProber = true;
boot.loader.grub.configurationLimit = 5;
boot.loader.efi.canTouchEfiVariables = true;
#boot.loader.grub.efiInstallAsRemovable = true;
boot.loader.grub.extraConfig = ''
GRUB_DISABLE_OS_PROBER=false
GRUB_TERMINAL_OUTPUT=console
'';
boot.loader.grub.gfxmodeBios = "1280x720"; # for BIOS, or
boot.loader.grub.gfxmodeEfi = "1280x720"; # for EFI
boot.loader.grub.gfxpayloadBios = "keep";
# Use latest kernel.
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelParams = [ "nvidia-drm.modeset=1" "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ];
networking.hostName = "nxs"; # Define your hostname.
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone.
time.timeZone = "Europe/Rome";
virtualisation.docker.enable = true;
# optional but sane:
virtualisation.docker.enableOnBoot = true;
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
# i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };
# Enable the X11 windowing system.
services.xserver = {
enable = true;
libinput = {
enable = true;
touchpad = {
naturalScrolling = true;
tapping = true;
disableWhileTyping = true;
clickMethod = "clickfinger";
};
};
displayManager.lightdm = {
enable = true;
autoLogin.enable = true;
autoLogin.user = "narrator";
};
windowManager.i3.enable = true;
videoDrivers = [ "amdgpu" "nvidia" ];
deviceSection = ''
BusID "PCI:1:0:0"
Driver "nvidia"
'';
};
# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
# services.pulseaudio.enable = true;
# OR
security.rtkit.enable = true;
services.pipewire = {
alsa.enable = true;
enable = true;
pulse.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
programs.fish.enable = true;
users.users.narrator = {
isNormalUser = true;
extraGroups = [ "wheel" "docker" ]; # Enable sudo for the user.
shell = pkgs.fish;
packages = with pkgs; [
tree
];
};
programs.firefox.enable = true;
# List packages installed in system profile.
# You can use https://search.nixos.org/ to find more packages (and options).
environment.systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
gnupg
wget
cryptsetup
xorg.xinit
os-prober
fish
htop
fzf
curl
git
pinentry-curses
lightdm
i3-gaps
awesome
blueman
];
fonts.packages = with pkgs; [
nerd-fonts.fira-code
nerd-fonts.droid-sans-mono
nerd-fonts.symbols-only
];
services.logind = {
lidSwitch = "ignore";
lidSwitchDocked = "ignore";
lidSwitchExternalPower = "lock";
extraConfig = ''
IdleAction=ignore
HandleSuspendKey=ignore
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore
SuspendKeyIgnoreInhibited=yes
LidSwitchIgnoreInhibited=yes
HandlePowerKey=poweroff
HandleSuspendKey=hibernate
'';
};
systemd.sleep.extraConfig = ''
AllowSuspend=no
AllowHibernation=no
AllowHybridSleep=no
AllowSuspendThenHibernate=no
'';
# firewall bc duh
networking.firewall.enable = true;
documentation.man.generateCaches = false;
# time sync
services.timesyncd.enable = true;
# bluetooth
hardware.bluetooth.enable = true;
services.blueman.enable = true;
# enable printing
services.printing.enable = true;
# enable openssh for remote access
services.openssh.enable = true;
programs.ssh.startAgent = true;
security.sudo.wheelNeedsPassword = false;
system.stateVersion = "25.05"; # Did you read the comment?
# GnuPG
programs.gnupg.agent = {
enable = true;
};
services.pcscd.enable = true;
systemd.services."getty@tty2".enable = true;
systemd.services."getty@tty3".enable = true;
hardware.graphics = {
enable = true;
};
# Load nvidia driver for Xorg and Wayland
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
#powerManagement.finegrained = true;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
open = true;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
# SSH config:
};
hardware.nvidia.forceFullCompositionPipeline = true;
systemd.services = {
systemd-suspend.environment.SYSTEMD_SLEEP_FREEZE_USER_SESSIONS = "false";
systemd-hibernate.environment.SYSTEMD_SLEEP_FREEZE_USER_SESSIONS = "false"; # if u care
};
hardware.nvidia.prime = {
offload.enable = true;
amdgpuBusId = "PCI:7:0:0";
nvidiaBusId = "PCI:1:0:0";
#amdgpuBusId = "PCI:54:0:0"; # If you have an AMD iGPU
};
}

View file

@ -1,101 +1,102 @@
{ config, lib, pkgs, inputs, ... }:
{
imports = [
inputs.nixvim.homeManagerModules.nixvim
inputs.self.homeManagerModules.copilot-cli
./i3.nix
./i3blocks.nix
./modules/neovim.nix
./modules/fish.nix
./modules/tmux.nix
./modules/home-manager/i3.nix
./modules/home-manager/i3blocks.nix
./modules/home-manager/neovim.nix
./modules/home-manager/fish.nix
./modules/home-manager/tmux.nix
];
home.username = "narrator";
home.homeDirectory = "/home/narrator";
home.stateVersion = "25.05";
programs.home-manager.enable = true;
programs.ssh = {
enable = true;
forwardAgent = true;
addKeysToAgent = "yes";
matchBlocks = {
"git.unime.it" = {
hostname = "git.unime.it";
port = 42000; # e.g. 2222
};
};
extraConfig = ''
Host git.nonaxiomatic.systems
ControlMaster no
'';
# Home Manager settings
home = {
username = "narrator";
homeDirectory = "/home/narrator";
stateVersion = "25.05";
packages = with pkgs; [
ssh-to-age
pinentry-curses
cryptsetup
grc
nix-prefetch-github
gemini-cli
gh-copilot
picard
chromaprint
xorg.xmodmap
pavucontrol
mumble
kiwix
kiwix-tools
aria2
teamspeak3
git
nicotine-plus
sl
firefox
i3blocks
strawberry
iproute2
gawk
inetutils
gnugrep
wireplumber
lm_sensors
btop
flameshot
xclip
psmisc
dmenu
picom
telegram-desktop
feh
alacritty
i3-gaps
lsd
polybar
tmux
zoxide
fortune
nixpkgs-fmt
rofi
pipewire
lshw
age
notepad-next
];
};
programs = {
home-manager.enable = true;
copilot-cli.enable = true;
direnv = {
enable = true;
nix-direnv.enable = true;
};
ssh = {
enable = true;
forwardAgent = true;
addKeysToAgent = "yes";
matchBlocks = {
"git.unime.it" = {
hostname = "git.unime.it";
port = 42000;
};
};
extraConfig = ''
Host git.nonaxiomatic.systems
ControlMaster no
'';
};
};
services.gpg-agent = {
enable = true;
defaultCacheTtl = 28800;
defaultCacheTtlSsh = 28800;
sshKeys = [ ]; # auto-populates from gpg keys
sshKeys = [ ];
};
programs.copilot-cli.enable = true;
home.packages = with pkgs; [
ssh-to-age
pinentry-curses
cryptsetup
grc
nix-prefetch-github
gemini-cli
gh-copilot
picard
chromaprint
xorg.xmodmap
pavucontrol
mumble
kiwix
kiwix-tools
aria2
teamspeak3
git
nicotine-plus
sl
firefox
i3blocks
strawberry
iproute2
gawk
inetutils
gnugrep
wireplumber
lm_sensors
btop
flameshot
xclip
psmisc
dmenu
picom
telegram-desktop
feh
alacritty
i3-gaps
lsd
polybar
tmux
zoxide
fortune
nixpkgs-fmt
rofi
pipewire
lshw
age
notepad-next
];
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}

View file

@ -0,0 +1,40 @@
{ config, lib, pkgs, ... }:
{
boot = {
loader = {
grub = {
enable = true;
efiSupport = true;
device = "nodev";
useOSProber = true;
configurationLimit = 5;
gfxmodeBios = "1280x720";
gfxmodeEfi = "1280x720";
gfxpayloadBios = "keep";
extraConfig = ''
GRUB_DISABLE_OS_PROBER=false
GRUB_TERMINAL_OUTPUT=console
'';
};
efi = {
efiSysMountPoint = "/boot/efi";
canTouchEfiVariables = true;
};
};
kernelPackages = pkgs.linuxPackages_latest;
kernelParams = [
"nvidia-drm.modeset=1"
"nvidia.NVreg_PreserveVideoMemoryAllocations=1"
];
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/31dbc3a8-dfdc-4177-8d3e-2b6e294e7daf";
fsType = "btrfs";
};
swapDevices = [
{ device = "/dev/disk/by-uuid/f9da6980-510f-4cce-bff5-50a791346c07"; }
];
}

View file

@ -0,0 +1,43 @@
{ config, lib, pkgs, ... }:
{
services.xserver = {
enable = true;
libinput = {
enable = true;
touchpad = {
naturalScrolling = true;
tapping = true;
disableWhileTyping = true;
clickMethod = "clickfinger";
};
};
displayManager.lightdm = {
enable = true;
autoLogin = {
enable = true;
user = "narrator";
};
};
windowManager.i3.enable = true;
};
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
};
services.blueman.enable = true;
services.printing.enable = true;
fonts.packages = with pkgs; [
nerd-fonts.fira-code
nerd-fonts.droid-sans-mono
nerd-fonts.symbols-only
];
}

View file

@ -0,0 +1,31 @@
{ config, lib, pkgs, ... }:
{
hardware = {
graphics.enable = true;
bluetooth.enable = true;
nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
open = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
forceFullCompositionPipeline = true;
prime = {
offload.enable = true;
amdgpuBusId = "PCI:7:0:0";
nvidiaBusId = "PCI:1:0:0";
};
};
};
services.xserver = {
videoDrivers = [ "amdgpu" "nvidia" ];
deviceSection = ''
BusID "PCI:1:0:0"
Driver "nvidia"
'';
};
}

View file

@ -0,0 +1,33 @@
{ config, lib, pkgs, ... }:
{
services.logind = {
lidSwitch = "ignore";
lidSwitchDocked = "ignore";
lidSwitchExternalPower = "lock";
extraConfig = ''
IdleAction=ignore
HandleSuspendKey=ignore
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore
SuspendKeyIgnoreInhibited=yes
LidSwitchIgnoreInhibited=yes
HandlePowerKey=poweroff
HandleSuspendKey=hibernate
'';
};
systemd.sleep.extraConfig = ''
AllowSuspend=no
AllowHibernation=no
AllowHybridSleep=no
AllowSuspendThenHibernate=no
'';
systemd.services = {
systemd-suspend.environment.SYSTEMD_SLEEP_FREEZE_USER_SESSIONS = "false";
systemd-hibernate.environment.SYSTEMD_SLEEP_FREEZE_USER_SESSIONS = "false";
"getty@tty2".enable = true;
"getty@tty3".enable = true;
};
}

View file

@ -0,0 +1,17 @@
{ lib, pkgs, config, inputs, ... }:
{
options.programs.copilot-cli.enable = lib.mkEnableOption "GitHub Copilot CLI";
config = lib.mkIf config.programs.copilot-cli.enable {
home.packages = [
(
inputs.nix-ai-tools.packages.${pkgs.system}.copilot-cli or
(inputs.nixpkgs.legacyPackages.${pkgs.system}.fetchgit {
url = "github:numtide/nix-ai-tools";
ref = "main";
}).packages.${pkgs.system}.copilot-cli
)
];
};
}

View file

@ -0,0 +1,22 @@
{ config, lib, ... }:
{
options.nixos.autoUpgrade = {
enable = lib.mkEnableOption "automatic NixOS upgrades";
flakePath = lib.mkOption {
type = lib.types.str;
description = "Path to the flake for auto-upgrade";
};
};
config = lib.mkIf config.nixos.autoUpgrade.enable {
system.autoUpgrade = {
enable = true;
flake = config.nixos.autoUpgrade.flakePath;
flags = [ "-L" ];
dates = "02:00";
randomizedDelaySec = "45min";
operation = "switch";
};
};
}