This commit is contained in:
Martin Benonisen 2024-12-04 16:27:03 +01:00
parent 977e20f19f
commit 87bb70fbcd
Signed by: mbeno
SSH Key Fingerprint: SHA256:iAzOA1WUAxocdh/WRWXcSg5nw2dJ1aDCvPuT+3ZjkwI
28 changed files with 299 additions and 218 deletions

View File

@ -14,16 +14,16 @@
}; };
# ... # ...
# Optional - updates underlying without waiting for nix-citizen to update # Optional - updates underlying without waiting for nix-citizen to update
}; };
outputs = outputs =
{ self {
, nixpkgs self,
, home-manager nixpkgs,
, ... home-manager,
...
}@inputs: }@inputs:
let let
system = "x86_64-linux"; system = "x86_64-linux";
@ -32,7 +32,6 @@
{ {
nixosConfigurations = { nixosConfigurations = {
zedd = nixpkgs.lib.nixosSystem { zedd = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
specialArgs = { inherit inputs self user; }; specialArgs = { inherit inputs self user; };

View File

@ -1,4 +1,9 @@
{ config, pkgs,lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {
# Enable OpenGL # Enable OpenGL
# Load nvidia driver for Xorg and Wayland # Load nvidia driver for Xorg and Wayland
@ -23,12 +28,10 @@
"vm.max_map_count" = 2147483642; "vm.max_map_count" = 2147483642;
"fs.file-max" = 524288; "fs.file-max" = 524288;
}; };
networking.extraHosts = networking.extraHosts = ''
''
127.0.0.1 zedd zedd.local 127.0.0.1 zedd zedd.local
''; '';
networking.hostName = "zedd"; # Define your hostname. networking.hostName = "zedd"; # Define your hostname.
time.timeZone = "Europe/Oslo"; time.timeZone = "Europe/Oslo";
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
@ -46,8 +49,7 @@
device = "/dev/data/data"; device = "/dev/data/data";
fsType = "ext4"; fsType = "ext4";
}; };
xdg.portal = xdg.portal = {
{
enable = true; enable = true;
xdgOpenUsePortal = true; xdgOpenUsePortal = true;
config = { config = {
@ -57,16 +59,22 @@
]; ];
}; };
}; };
extraPortals = (with pkgs; [ extraPortals = (
with pkgs;
[
# unstable.xdg-desktop-portal-hyprland # unstable.xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk xdg-desktop-portal-gtk
]); ]
);
}; };
# Allow unfree packages # Allow unfree packages
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [
"nix-command"
"flakes"
];
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
virtualisation.docker.liveRestore = false; virtualisation.docker.liveRestore = false;
system.stateVersion = "23.11"; # Did you read the comment? system.stateVersion = "23.11"; # Did you read the comment?

View File

@ -1,4 +1,10 @@
{ inputs, self, pks, ... }: { {
inputs,
self,
pks,
...
}:
{
imports = [ imports = [
./configuration.nix ./configuration.nix
./hardware-configuration.nix ./hardware-configuration.nix

View File

@ -1,32 +1,42 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = imports = [
[
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = [
"vmd"
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{
device = "/dev/disk/by-uuid/d05743bb-9448-483b-8002-caa0da402820"; device = "/dev/disk/by-uuid/d05743bb-9448-483b-8002-caa0da402820";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{
device = "/dev/disk/by-uuid/4B24-7005"; device = "/dev/disk/by-uuid/4B24-7005";
fsType = "vfat"; fsType = "vfat";
}; };
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (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 # still possible to use this option, but it's recommended to use it in conjunction

View File

@ -1 +1,10 @@
{ imports = [ ./users.nix ./services ./hardware.nix ./fonts.nix ./security.nix ./programs.nix ]; } {
imports = [
./users.nix
./services
./hardware.nix
./fonts.nix
./security.nix
./programs.nix
];
}

View File

@ -1,4 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }:
{
environment.systemPackages = with pkgs; [ twemoji-color-font ]; environment.systemPackages = with pkgs; [ twemoji-color-font ];
fonts.packages = with pkgs; [ fonts.packages = with pkgs; [
fira-code fira-code

View File

@ -1,6 +1,8 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
environment.sessionVariables = { LIBVA_DRIVER_NAME = "nvidia"; }; environment.sessionVariables = {
LIBVA_DRIVER_NAME = "nvidia";
};
nixpkgs.config.packageOverrides = pkgs: { nixpkgs.config.packageOverrides = pkgs: {
intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; }; intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; };
@ -8,12 +10,7 @@
hardware = { hardware = {
enableRedistributableFirmware = true; enableRedistributableFirmware = true;
cpu.intel.updateMicrocode = true; cpu.intel.updateMicrocode = true;
pulseaudio = { graphics = {
enable =true;
support32Bit = true;
};
graphics =
{
enable = true; enable = true;
enable32Bit = true; enable32Bit = true;
extraPackages = with pkgs; [ extraPackages = with pkgs; [

View File

@ -1,9 +1,7 @@
{ ... }: { ... }:
let let
nix-alien-pkgs = import nix-alien-pkgs =
( import (builtins.fetchTarball "https://github.com/thiagokokada/nix-alien/tarball/master")
builtins.fetchTarball "https://github.com/thiagokokada/nix-alien/tarball/master"
)
{ }; { };
in in
{ {

View File

@ -1,4 +1,10 @@
{ config, pkgs, inputs, ... }: { {
config,
pkgs,
inputs,
...
}:
{
services.flatpak.enable = true; services.flatpak.enable = true;
programs.nix-ld.enable = true; programs.nix-ld.enable = true;
programs.nix-ld.libraries = [ programs.nix-ld.libraries = [
@ -16,11 +22,10 @@
pkgs.mangohud pkgs.mangohud
]; ];
extraEnv = { extraEnv = {
MANGOHUD=true; MANGOHUD = true;
}; };
}; };
}; };
programs.thunar.enable = true; programs.thunar.enable = true;
programs.gnupg.agent = { programs.gnupg.agent = {

View File

@ -1,4 +1,5 @@
{ config, pkgs, ... }: { { config, pkgs, ... }:
{
# Enable sudo # Enable sudo
security.sudo = { security.sudo = {
enable = true; enable = true;

View File

@ -1,12 +1,12 @@
{ config, pkgs, ... }:
{ config, pkgs, ... }: { {
security.rtkit.enable = true; security.rtkit.enable = true;
services.pipewire = { services.pipewire = {
enable = true; enable = true;
alsa.enable = true; alsa.enable = true;
alsa.support32Bit = true; alsa.support32Bit = true;
pulse.enable = true; pulse.enable = true;
# If you want to use JACK applications, uncomment this # If you want to use JACK applications, uncomment this
#jack.enable = true; #jack.enable = true;
}; };
} }

View File

@ -1,4 +1,5 @@
{ config, pkgs, ... }: { { config, pkgs, ... }:
{
services.fwupd.enable = true; services.fwupd.enable = true;
programs.dconf.enable = true; programs.dconf.enable = true;
@ -15,10 +16,9 @@
enable = true; enable = true;
settings.PasswordAuthentication = true; settings.PasswordAuthentication = true;
}; };
imports = imports = [
[ ./networking.nix ./networking.nix
./audio.nix ./audio.nix
./xserver.nix ./xserver.nix
./vscode.nix
]; ];
} }

View File

@ -1,5 +1,5 @@
{ config, pkgs, ... }:
{ config, pkgs, ... }: { {
networking = { networking = {
wireless = { wireless = {
enable = false; enable = false;

View File

@ -1,8 +1,7 @@
{ config, pkgs, ... }:
{ config, pkgs, ... }: { {
services = { services = {
displayManager = displayManager = {
{
defaultSession = "none+i3"; defaultSession = "none+i3";
autoLogin.enable = true; autoLogin.enable = true;
autoLogin.user = "mbeno"; autoLogin.user = "mbeno";
@ -44,18 +43,17 @@
"; ";
} }
]; ];
screenSection = screenSection = ''
''
Option "metamodes" "DP-2: 2560x1440_144 +0+0, DP-0: 1920x1080_144 +2560+0" Option "metamodes" "DP-2: 2560x1440_144 +0+0, DP-0: 1920x1080_144 +2560+0"
''; '';
windowManager.i3 = { windowManager.i3 = {
enable = true; enable = true;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
dmenu #application launcher most people use dmenu # application launcher most people use
i3status # gives you the default i3 status bar i3status # gives you the default i3 status bar
i3lock i3lock
# i3lock #default i3 screen locker # i3lock #default i3 screen locker
i3blocks #if you are planning on using i3blocks over i3status i3blocks # if you are planning on using i3blocks over i3status
polybar polybar
rofi rofi
nitrogen nitrogen

View File

@ -1,4 +1,5 @@
{ config, pkgs, ... }: { { config, pkgs, ... }:
{
programs.zsh.enable = true; programs.zsh.enable = true;
environment.shells = with pkgs; [ zsh ]; environment.shells = with pkgs; [ zsh ];
@ -6,7 +7,12 @@
shell = pkgs.zsh; shell = pkgs.zsh;
isNormalUser = true; isNormalUser = true;
description = "Martin"; description = "Martin";
extraGroups = [ "networkmanager" "wheel" "docker" "audio" ]; extraGroups = [
"networkmanager"
"wheel"
"docker"
"audio"
];
packages = with pkgs; [ packages = with pkgs; [
alacritty alacritty
mumble mumble

View File

@ -1,10 +1,18 @@
{ pkgs, inputs, user, ... }: { {
pkgs,
inputs,
user,
...
}:
{
imports = [ inputs.home-manager.nixosModules.home-manager ]; imports = [ inputs.home-manager.nixosModules.home-manager ];
home-manager = { home-manager = {
useUserPackages = true; useUserPackages = true;
useGlobalPkgs = true; useGlobalPkgs = true;
extraSpecialArgs = { inherit pkgs inputs user; }; extraSpecialArgs = { inherit pkgs inputs user; };
users.${user} = { pkgs, ... }: { users.${user} =
{ pkgs, ... }:
{
imports = [ imports = [
./programs/neovim ./programs/neovim
# ./programs/firefox # ./programs/firefox

View File

@ -1,4 +1,5 @@
{ pkgs, inputs, ... }: { { pkgs, inputs, ... }:
{
home.packages = with pkgs; [ home.packages = with pkgs; [
# Generic tools # Generic tools
age age
@ -76,6 +77,7 @@
nodejs nodejs
nodePackages.pnpm nodePackages.pnpm
typescript typescript
nixfmt-rfc-style
# Py stuff # Py stuff
(python312.withPackages ( (python312.withPackages (
@ -98,6 +100,5 @@
gcc gcc
gnumake gnumake
]; ];
} }

View File

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
{ {
services.dunst = { services.dunst = {
@ -36,7 +41,7 @@
corner_radius = 10; corner_radius = 10;
# follow = "mouse"; # follow = "mouse";
font = "Source Sans Pro 10"; font = "Source Sans Pro 10";
format = "<b>%s</b>\\n%b"; #format = "<span foreground='#f3f4f5'><b>%s %p</b></span>\n%b" format = "<b>%s</b>\\n%b"; # format = "<span foreground='#f3f4f5'><b>%s %p</b></span>\n%b"
frame_color = "#232323"; frame_color = "#232323";
frame_width = 1; frame_width = 1;
offset = "15x15"; offset = "15x15";
@ -57,7 +62,9 @@
browser = "/usr/bin/env firefox -new-tab"; browser = "/usr/bin/env firefox -new-tab";
}; };
fullscreen_delay_everything = { fullscreen = "delay"; }; fullscreen_delay_everything = {
fullscreen = "delay";
};
urgency_critical = { urgency_critical = {
background = "#d64e4e"; background = "#d64e4e";

View File

@ -1,6 +1,8 @@
{ pkgs {
, inputs pkgs,
, ... inputs,
...
}: }:
# games # games
{ } {
}

View File

@ -1,4 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }:
{
programs = { programs = {
neovim = { neovim = {
enable = true; enable = true;

View File

@ -1,4 +1,5 @@
{ config, pkgs, ... }: { { config, pkgs, ... }:
{
xdg.configFile."rofi/config.rasi".text = '' xdg.configFile."rofi/config.rasi".text = ''
/*Dracula theme based on the Purple official rofi theme*/ /*Dracula theme based on the Purple official rofi theme*/
@ -138,4 +139,3 @@
@theme "${pkgs.rofi-unwrapped}/share/rofi/themes/android_notification.rasi" @theme "${pkgs.rofi-unwrapped}/share/rofi/themes/android_notification.rasi"
''; '';
} }

View File

@ -1,7 +1,14 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
with lib; with lib;
let cfg = config.tmux.enable; let
in { cfg = config.tmux.enable;
in
{
options.tmux.enable = mkEnableOption "tmux"; options.tmux.enable = mkEnableOption "tmux";
config = mkIf cfg { config = mkIf cfg {
programs.tmux = { programs.tmux = {

View File

@ -1,4 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }:
{
programs.vscode = { programs.vscode = {
enable = true; enable = true;
enableUpdateCheck = true; enableUpdateCheck = true;
@ -17,6 +18,7 @@
ms-python.python ms-python.python
]; ];
userSettings = { userSettings = {
"window.titleBarStyle" = "custom"; "window.titleBarStyle" = "custom";
"editor.formatOnSave" = true; "editor.formatOnSave" = true;

View File

@ -1,4 +1,5 @@
{ pkgs, config, ... }: { { pkgs, config, ... }:
{
home.file.".local/bin/rofi-launcher" = { home.file.".local/bin/rofi-launcher" = {
source = ./rofi-launcher.sh; source = ./rofi-launcher.sh;
executable = true; executable = true;

View File

@ -1,7 +1,6 @@
{ pkgs, config, ... }: { pkgs, config, ... }:
let let
sshotp = pkgs.writeScriptBin "sshotp" sshotp = pkgs.writeScriptBin "sshotp" ''
''
#!/usr/bin/env expect #!/usr/bin/env expect
set stty_init -echo set stty_init -echo
set timeout 300 set timeout 300
@ -20,7 +19,10 @@ let
''; '';
ssh-dresden = pkgs.writeShellApplication { ssh-dresden = pkgs.writeShellApplication {
name = "ssh-dresden"; name = "ssh-dresden";
runtimeInputs = [ pkgs.rbw pkgs.expect ]; runtimeInputs = [
pkgs.rbw
pkgs.expect
];
text = '' text = ''
#!/usr/bin/env bash #!/usr/bin/env bash
totp=$(rbw get -f "TOTP" rlogin) totp=$(rbw get -f "TOTP" rlogin)
@ -41,4 +43,3 @@ in
}; };
}; };
} }

View File

@ -1,4 +1,5 @@
{ user, ... }: { { user, ... }:
{
sops = { sops = {
age.keyFile = "/home/${user}/.config/sops/age/keys.txt"; age.keyFile = "/home/${user}/.config/sops/age/keys.txt";
defaultSopsFile = ../../secrets/${user}/secret.yaml; defaultSopsFile = ../../secrets/${user}/secret.yaml;

View File

@ -1,4 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }:
{
programs.ssh = { programs.ssh = {
enable = true; enable = true;
controlMaster = "auto"; controlMaster = "auto";

View File

@ -1,4 +1,10 @@
{ user, pkgs, config, ... }: { {
user,
pkgs,
config,
...
}:
{
home.packages = with pkgs; [ fd ]; home.packages = with pkgs; [ fd ];
programs.zsh = { programs.zsh = {
enable = true; enable = true;
@ -53,12 +59,17 @@
zplug = { zplug = {
enable = true; enable = true;
plugins = [ plugins = [
{ name = "plugins/git"; tags = [ "from:oh-my-zsh" ]; } {
{ name = "modules/prompt"; tags = [ "from:prezto" ]; } name = "plugins/git";
tags = [ "from:oh-my-zsh" ];
}
{
name = "modules/prompt";
tags = [ "from:prezto" ];
}
{ name = "zsh-users/zsh-autosuggestions"; } { name = "zsh-users/zsh-autosuggestions"; }
{ {
name = name = "zsh-users/zsh-history-substring-search";
"zsh-users/zsh-history-substring-search";
} }
]; ];
}; };