feat: Add nixos configuration flake

This commit is contained in:
Arne Dußin 2025-03-27 01:08:55 +03:00
parent 2c0e4f885e
commit d00c3204f7
4 changed files with 362 additions and 0 deletions

200
nix/configuration.nix Normal file
View file

@ -0,0 +1,200 @@
{ hostname, config, lib, pkgs, ... }:
{
imports =
[
./hardware-${hostname}.nix
# <home-manager/nixos>
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
################################
# Hardware configuration #
################################
hardware = {
graphics = { enable = true; enable32Bit = true; };
bluetooth = { enable = true; powerOnBoot = true; };
};
####################
# Networking #
####################
networking = {
hostName = "${hostname}";
networkmanager.enable = true;
# proxy.default = "naiveproxy+https://fries:8.S%3ECi42%40h%2CF%7D%3EP@ruffling.org/#french_connection:443";
};
# Set your time zone.
time.timeZone = "Europe/Moscow";
# Internationalisation
i18n = {
defaultLocale = "en_US.UTF-8";
inputMethod = {
enable = true;
type = "fcitx5";
};
};
console = {
font = "Lat2-Terminus16";
useXkbConfig = true;
};
# Enable rtkit so pipewire can aquire real-time priority
security.rtkit.enable = true;
# Add nur for more packages!
# nixpkgs.config.packageOverrides = pkgs: {
# nur =
# import ( builtins.fetchTarball "https://github.com/nix-community/NUR/archive/main.tar.gz" )
# {
# inherit pkgs;
# };
# };
# Exception for packages that are not free but we would still like to install.
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg)
[
"steam"
"steam-unwrapped"
"vintagestory"
];
nixpkgs.config.permittedInsecurePackages = [
"dotnet-runtime-7.0.20" # Required for vintagestory
];
################################
# Packages for ALL users #
################################
environment.systemPackages = with pkgs; [
alacritty
asciidoctor-with-extensions
bat
bluez
bluez-tools
brightnessctl
dunst
eww
feh
file
fzf
git
git-lfs
helix
htop
linux-manual
maim
man-pages
man-pages-posix
mpv
mumble
nix-your-shell
openvpn
pass
pavucontrol
playerctl
python3
ripgrep
rofi
uutils-coreutils # TODO: Once satisfied switch to `uutils-coreutils-noprefix`
vim
webcord
wget
wine
winetricks
xarchiver
xclip
xdo
zathura
]
++ [
nur.repos.sn0wm1x.naiveproxy-bin
];
###############
# Fonts #
###############
fonts.packages = with pkgs; with nerd-fonts; [
agave
anonymice
daddy-time-mono
envy-code-r
fantasque-sans-mono
hurmit
iosevka
iosevka-term-slab
jetbrains-mono
source-han-mono
tamsyn
tamzen
];
##################
# Programs #
##################
programs = {
firefox = {
enable = true;
languagePacks = [ "de" "en-GB" ];
};
gnupg.agent = {
enable = true;
enableSSHSupport = true;
pinentryPackage = pkgs.pinentry-curses;
};
mtr.enable = true;
};
##################
# Services #
##################
services = {
blueman.enable = true;
locate.enable = true;
pcscd.enable = true;
picom = {
enable = true;
backend = "glx";
};
pipewire = { enable = true; pulse.enable = true; };
printing.enable = true;
xserver = {
enable = true;
displayManager.startx.enable = true;
windowManager.leftwm.enable = true;
xkb.layout = "us";
xkb.variant = "dvp";
xkb.options = "caps:escape,compose:94";
};
};
##########################
# User definitions #
##########################
users.users.zentux = {
shell = pkgs.nushell;
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "video" "kvm" ];
packages = with pkgs; [
nixd
steam
vintagestory
element-desktop
signal-desktop
telegram-desktop
];
# home.stateVersion = "24.11";
};
# Respect your shit. Don't touch this.
system.stateVersion = "24.11";
}

92
nix/flake.lock generated Normal file
View file

@ -0,0 +1,92 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nur",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1742889210,
"narHash": "sha256-hw63HnwnqU3ZQfsMclLhMvOezpM7RSB0dMAtD5/sOiw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "698214a32beb4f4c8e3942372c694f40848b360d",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nur": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": [
"nixpkgs"
],
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1743025561,
"narHash": "sha256-wbszHA2bJaA9TSLkiU1Gqby4noRNhhWi9CNoFqxSPj0=",
"owner": "nix-community",
"repo": "NUR",
"rev": "dcc6f70a7f8c69b50a266de40ca6228f01a50c88",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"nur": "nur"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nur",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733222881,
"narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "49717b5af6f80172275d47a418c9719a31a78b53",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

31
nix/flake.nix Normal file
View file

@ -0,0 +1,31 @@
{
description = "Marm's NixOS flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
nur = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:nix-community/NUR";
};
};
outputs = { self, nixpkgs, nur, ... } @ inputs:
let
inherit (self) outputs; # outputs = self.outputs;
in
{
nixosConfigurations = {
lamarr = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs;
hostname = "lamarr";
};
modules = [
./configuration.nix
nur.modules.nixos.default
];
};
};
};
}

39
nix/hardware-lamarr.nix Normal file
View file

@ -0,0 +1,39 @@
# 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 = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/b203a7f3-1328-4702-bea5-f29a946b93be";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/312E-3729";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
# 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.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}