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
};
outputs =
{ self
, nixpkgs
, home-manager
, ...
{
self,
nixpkgs,
home-manager,
...
}@inputs:
let
system = "x86_64-linux";
@ -32,7 +32,6 @@
{
nixosConfigurations = {
zedd = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs self user; };

View File

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

View File

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

View File

@ -1,31 +1,41 @@
# 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, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
];
imports = [
(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.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/d05743bb-9448-483b-8002-caa0da402820";
fsType = "ext4";
};
fileSystems."/boot" =
{
device = "/dev/disk/by-uuid/4B24-7005";
fsType = "vfat";
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/d05743bb-9448-483b-8002-caa0da402820";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/4B24-7005";
fsType = "vfat";
};
# 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

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 ];
fonts.packages = with pkgs; [
fira-code

View File

@ -1,36 +1,33 @@
{ 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; };
};
hardware = {
enableRedistributableFirmware = true;
cpu.intel.updateMicrocode = true;
pulseaudio = {
enable =true;
support32Bit = true;
};
graphics =
{
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [
vaapiVdpau
mangohud
nvidia-vaapi-driver
intel-media-driver
intel-vaapi-driver
libvdpau-va-gl
];
extraPackages32 = with pkgs.pkgsi686Linux; [
mangohud
intel-media-driver
intel-vaapi-driver
];
graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [
vaapiVdpau
mangohud
nvidia-vaapi-driver
intel-media-driver
intel-vaapi-driver
libvdpau-va-gl
];
extraPackages32 = with pkgs.pkgsi686Linux; [
mangohud
intel-media-driver
intel-vaapi-driver
];
};
};
nvidia = {
modesetting.enable = true;
powerManagement.enable = false;

View File

@ -1,10 +1,8 @@
{ ... }:
let
nix-alien-pkgs = import
(
builtins.fetchTarball "https://github.com/thiagokokada/nix-alien/tarball/master"
)
{ };
nix-alien-pkgs =
import (builtins.fetchTarball "https://github.com/thiagokokada/nix-alien/tarball/master")
{ };
in
{
environment.systemPackages = with nix-alien-pkgs; [

View File

@ -1,4 +1,10 @@
{ config, pkgs, inputs, ... }: {
{
config,
pkgs,
inputs,
...
}:
{
services.flatpak.enable = true;
programs.nix-ld.enable = true;
programs.nix-ld.libraries = [
@ -7,20 +13,19 @@
];
programs.steam = {
enable = true;
extraPackages = [
pkgs.mangohud
];
extraPackages = [
pkgs.mangohud
];
package = pkgs.steam.override {
extraLibraries = pkgs: [
pkgs.mangohud
];
extraEnv = {
MANGOHUD=true;
MANGOHUD = true;
};
};
};
programs.thunar.enable = true;
programs.gnupg.agent = {

View File

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

View File

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

View File

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

View File

@ -1,19 +1,19 @@
{ config, pkgs, ... }: {
{ config, pkgs, ... }:
{
networking = {
wireless = {
enable = false;
networks = {
# "bennynet" = {
# pskRaw = "85e8f17e02f4b4df5ddc9b95d1a4256b3c2608fcc8dfa1860b693d06c2a0bf1f";
# };
wireless = {
enable = false;
networks = {
# "bennynet" = {
# pskRaw = "85e8f17e02f4b4df5ddc9b95d1a4256b3c2608fcc8dfa1860b693d06c2a0bf1f";
# };
};
};
firewall = {
enable = true;
allowedTCPPorts = [ 22 ];
extraCommands = "iptables -A INPUT -s 192.168.0.0/16 -j ACCEPT";
};
};
firewall = {
enable = true;
allowedTCPPorts = [ 22 ];
extraCommands = "iptables -A INPUT -s 192.168.0.0/16 -j ACCEPT";
};
};
}
}

View File

@ -1,13 +1,12 @@
{ config, pkgs, ... }: {
{ config, pkgs, ... }:
{
services = {
displayManager =
{
defaultSession = "none+i3";
autoLogin.enable = true;
autoLogin.user = "mbeno";
displayManager = {
defaultSession = "none+i3";
autoLogin.enable = true;
autoLogin.user = "mbeno";
};
};
logind.extraConfig = "IdleAction=ignore";
xserver = {
exportConfiguration = true;
@ -44,18 +43,17 @@
";
}
];
screenSection =
''
Option "metamodes" "DP-2: 2560x1440_144 +0+0, DP-0: 1920x1080_144 +2560+0"
'';
screenSection = ''
Option "metamodes" "DP-2: 2560x1440_144 +0+0, DP-0: 1920x1080_144 +2560+0"
'';
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
dmenu #application launcher most people use
dmenu # application launcher most people use
i3status # gives you the default i3 status bar
i3lock
# 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
rofi
nitrogen
@ -63,4 +61,4 @@
};
};
};
}
}

View File

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

View File

@ -1,50 +1,58 @@
{ pkgs, inputs, user, ... }: {
{
pkgs,
inputs,
user,
...
}:
{
imports = [ inputs.home-manager.nixosModules.home-manager ];
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = { inherit pkgs inputs user; };
users.${user} = { pkgs, ... }: {
imports = [
./programs/neovim
# ./programs/firefox
./programs/tmux
./programs/dunst
./programs/rofi
./programs/obs-studio
./programs/vscode
# ./programs/games
./scripts
./zsh
./ssh
./services/ssh-office.nix
./packages
];
tmux.enable = true;
# firefox.enable = true;
xdg.enable = true;
services.picom = {
enable = true;
settings = {
unredir-if-possible = false;
backend = "xrender"; # try "glx" if xrender doesn't help
vsync = true;
users.${user} =
{ pkgs, ... }:
{
imports = [
./programs/neovim
# ./programs/firefox
./programs/tmux
./programs/dunst
./programs/rofi
./programs/obs-studio
./programs/vscode
# ./programs/games
./scripts
./zsh
./ssh
./services/ssh-office.nix
./packages
];
tmux.enable = true;
# firefox.enable = true;
xdg.enable = true;
services.picom = {
enable = true;
settings = {
unredir-if-possible = false;
backend = "xrender"; # try "glx" if xrender doesn't help
vsync = true;
};
};
};
services.gnome-keyring.enable = true;
home = {
username = "${user}";
homeDirectory = "/home/${user}";
stateVersion = "23.11";
};
programs.home-manager.enable = true;
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
programs.firefox.enable = true;
services.gnome-keyring.enable = true;
home = {
username = "${user}";
homeDirectory = "/home/${user}";
stateVersion = "23.11";
};
programs.home-manager.enable = true;
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
programs.firefox.enable = true;
};
};
};
}

View File

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

View File

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
services.dunst = {
@ -36,7 +41,7 @@
corner_radius = 10;
# follow = "mouse";
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_width = 1;
offset = "15x15";
@ -57,7 +62,9 @@
browser = "/usr/bin/env firefox -new-tab";
};
fullscreen_delay_everything = { fullscreen = "delay"; };
fullscreen_delay_everything = {
fullscreen = "delay";
};
urgency_critical = {
background = "#d64e4e";

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
programs.vscode = {
enable = true;
enableUpdateCheck = true;
@ -15,8 +16,9 @@
github.copilot-chat
arrterian.nix-env-selector
ms-python.python
];
userSettings = {
"window.titleBarStyle" = "custom";
"editor.formatOnSave" = true;

View File

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

View File

@ -1,26 +1,28 @@
{ pkgs, config, ... }:
let
sshotp = pkgs.writeScriptBin "sshotp"
''
#!/usr/bin/env expect
set stty_init -echo
set timeout 300
set totp [lindex $argv 0];
puts "Our TOTP $totp"
spawn ssh -D 20000 dresden.uio.no
expect {
-re {.*(Verification_Code):} {
send -- "$totp\r"
exp_continue
}
-re {.*dresden.*} {
wait
}
}
'';
sshotp = pkgs.writeScriptBin "sshotp" ''
#!/usr/bin/env expect
set stty_init -echo
set timeout 300
set totp [lindex $argv 0];
puts "Our TOTP $totp"
spawn ssh -D 20000 dresden.uio.no
expect {
-re {.*(Verification_Code):} {
send -- "$totp\r"
exp_continue
}
-re {.*dresden.*} {
wait
}
}
'';
ssh-dresden = pkgs.writeShellApplication {
name = "ssh-dresden";
runtimeInputs = [ pkgs.rbw pkgs.expect ];
runtimeInputs = [
pkgs.rbw
pkgs.expect
];
text = ''
#!/usr/bin/env bash
totp=$(rbw get -f "TOTP" rlogin)
@ -41,4 +43,3 @@ in
};
};
}

View File

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

View File

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

View File

@ -1,4 +1,10 @@
{ user, pkgs, config, ... }: {
{
user,
pkgs,
config,
...
}:
{
home.packages = with pkgs; [ fd ];
programs.zsh = {
enable = true;
@ -53,12 +59,17 @@
zplug = {
enable = true;
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-history-substring-search";
name = "zsh-users/zsh-history-substring-search";
}
];
};