Add NixOS config
This commit is contained in:
commit
6020d64797
43 changed files with 1372 additions and 0 deletions
53
nixos/configuration.nix
Normal file
53
nixos/configuration.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# 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 =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
./pkgs.nix
|
||||
./fonts.nix
|
||||
./modules/bundle.nix
|
||||
];
|
||||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
networking.hostName = "TARS";
|
||||
networking.networkmanager.enable = true;
|
||||
networking.firewall.checkReversePath = "loose";
|
||||
|
||||
time.timeZone = "Europe/Paris";
|
||||
|
||||
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
keyMap = "mod-dh-iso-us";
|
||||
};
|
||||
|
||||
|
||||
# I need to figure out how this works
|
||||
# services.printing.enable = true;
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
services.pipewire.wireplumber.extraConfig.no-ucm = {
|
||||
"monitor.alsa.properties" = {
|
||||
"alsa.use-ucm" = false;
|
||||
};
|
||||
};
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
}
|
||||
|
||||
6
nixos/fonts.nix
Normal file
6
nixos/fonts.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ pkgs, ... }: {
|
||||
fonts.packages = with pkgs; [
|
||||
nerd-fonts.iosevka-term
|
||||
nerd-fonts.jetbrains-mono
|
||||
];
|
||||
}
|
||||
45
nixos/hardware-configuration.nix
Normal file
45
nixos/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ "dm-snapshot" "cryptd" ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-label/NixOS-Root";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-label/NixOS-Encrypted";
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-label/NixOS-Boot";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/swapfile";
|
||||
size = 8 * 1024;
|
||||
}
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp192s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
5
nixos/modules/brightness.nix
Normal file
5
nixos/modules/brightness.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
services.udev.extraRules = ''
|
||||
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="amdgpu_bl1", GROUP="video", MODE="0660"
|
||||
'';
|
||||
}
|
||||
16
nixos/modules/bundle.nix
Normal file
16
nixos/modules/bundle.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
imports = [
|
||||
./hypr/bundle.nix
|
||||
./steam.nix
|
||||
./waybar.nix
|
||||
./user.nix
|
||||
./brightness.nix
|
||||
./fingerprint.nix
|
||||
./rebinding.nix
|
||||
./foot.nix
|
||||
./git.nix
|
||||
./thunderbird.nix
|
||||
./lidswitch.nix
|
||||
];
|
||||
}
|
||||
|
||||
3
nixos/modules/fingerprint.nix
Normal file
3
nixos/modules/fingerprint.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
services.fprintd.enable = true;
|
||||
}
|
||||
7
nixos/modules/foot.nix
Normal file
7
nixos/modules/foot.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{ pkgs, ... }: {
|
||||
programs.foot = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
}
|
||||
6
nixos/modules/git.nix
Normal file
6
nixos/modules/git.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ pkgs, ... }: {
|
||||
# For libsecret
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
security.pam.services.login.enableGnomeKeyring = true;
|
||||
security.pam.services.hyprlock.enableGnomeKeyring = true;
|
||||
}
|
||||
6
nixos/modules/hypr/bundle.nix
Normal file
6
nixos/modules/hypr/bundle.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./hyprland.nix
|
||||
./hyprlock.nix
|
||||
];
|
||||
}
|
||||
5
nixos/modules/hypr/hyprland.nix
Normal file
5
nixos/modules/hypr/hyprland.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{ pkgs, ...}: {
|
||||
programs.hyprland.enable = true;
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
}
|
||||
|
||||
4
nixos/modules/hypr/hyprlock.nix
Normal file
4
nixos/modules/hypr/hyprlock.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
programs.hyprlock.enable = true;
|
||||
services.hypridle.enable = true;
|
||||
}
|
||||
4
nixos/modules/lidswitch.nix
Normal file
4
nixos/modules/lidswitch.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
services.logind.settings.Login.HandleLidSwitch = "suspend";
|
||||
services.logind.settings.Login.HandleLidSwitchDocked = "ignore";
|
||||
}
|
||||
14
nixos/modules/rebinding.nix
Normal file
14
nixos/modules/rebinding.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ pkgs, ... }: {
|
||||
services.keyd.enable = true;
|
||||
|
||||
services.keyd.keyboards = {
|
||||
default = {
|
||||
ids = [ "*" ];
|
||||
settings = {
|
||||
main = {
|
||||
capslock = "overload(control, esc)";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
4
nixos/modules/regreet.nix
Normal file
4
nixos/modules/regreet.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
programs.regreet.enable = true;
|
||||
security.pam.services.greetd.enableGnomeKeyring = true;
|
||||
}
|
||||
3
nixos/modules/steam.nix
Normal file
3
nixos/modules/steam.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{ lib, pkgs, ... }: {
|
||||
programs.steam.enable = true;
|
||||
}
|
||||
3
nixos/modules/thunderbird.nix
Normal file
3
nixos/modules/thunderbird.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.thunderbird.enable = true;
|
||||
}
|
||||
31
nixos/modules/user.nix
Normal file
31
nixos/modules/user.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ pkgs, ...} : {
|
||||
programs.fish.enable = true;
|
||||
documentation.man.generateCaches = false;
|
||||
|
||||
# virtualisation.docker.enable = true;
|
||||
virtualisation.containers.enable = true;
|
||||
virtualisation = {
|
||||
podman = {
|
||||
enable = true;
|
||||
|
||||
dockerCompat = true;
|
||||
defaultNetwork.settings = { dns_enabled = true; };
|
||||
};
|
||||
};
|
||||
|
||||
users = {
|
||||
defaultUserShell = pkgs.bash;
|
||||
users.zeph = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
"video"
|
||||
"kvm"
|
||||
"docker"
|
||||
];
|
||||
packages = with pkgs; [];
|
||||
};
|
||||
};
|
||||
services.fwupd.enable = true;
|
||||
}
|
||||
3
nixos/modules/waybar.nix
Normal file
3
nixos/modules/waybar.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.waybar.enable = true;
|
||||
}
|
||||
11
nixos/modules/xfce.nix
Normal file
11
nixos/modules/xfce.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ pkgs, ... }: {
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
desktopManager.xfce.enable = true;
|
||||
# Don't start on boot
|
||||
displayManager.startx = {
|
||||
enable = true;
|
||||
generateScript = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
81
nixos/pkgs.nix
Normal file
81
nixos/pkgs.nix
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Editors
|
||||
helix
|
||||
vim
|
||||
sioyek
|
||||
|
||||
# Dev stuff
|
||||
podman-compose
|
||||
gitFull
|
||||
go-swag
|
||||
gcc
|
||||
go
|
||||
gopls
|
||||
nixd
|
||||
# texlive.combined.scheme-medium
|
||||
(pkgs.texlive.combine { inherit (pkgs.texlive) scheme-medium csvsimple; })
|
||||
texlab
|
||||
typst
|
||||
tinymist
|
||||
ffmpeg
|
||||
altair
|
||||
|
||||
# Rust toolchain
|
||||
cargo
|
||||
cargo-cache
|
||||
rust-analyzer
|
||||
rustc
|
||||
rustfmt
|
||||
clippy
|
||||
|
||||
# System stuff
|
||||
xfce.thunar-bare
|
||||
fprintd
|
||||
rclone
|
||||
unzip
|
||||
brightnessctl
|
||||
wl-clipboard
|
||||
fastfetch
|
||||
starship
|
||||
home-manager
|
||||
capitaine-cursors-themed
|
||||
# adwaita-icon-theme
|
||||
libsecret
|
||||
lsd
|
||||
protonvpn-gui
|
||||
wireguard-tools
|
||||
|
||||
# Internet
|
||||
librewolf
|
||||
bitwarden-desktop
|
||||
# ente-auth
|
||||
signal-desktop
|
||||
strawberry
|
||||
|
||||
# Office (and fun)
|
||||
godot
|
||||
libreoffice
|
||||
mpv
|
||||
gimp
|
||||
|
||||
# Important hypr* things
|
||||
fuzzel
|
||||
hyprpaper
|
||||
hyprpolkitagent
|
||||
hyprsunset
|
||||
hyprshot
|
||||
mako
|
||||
swayosd
|
||||
];
|
||||
|
||||
# Unfree pkgs
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||
"steam"
|
||||
"steam-original"
|
||||
"steam-unwrapped"
|
||||
"steam-run"
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue