This commit is contained in:
Martin Benonisen 2024-09-13 18:42:10 +02:00
parent c56c8d8fef
commit ab676a4e01
Signed by: mbeno
SSH Key Fingerprint: SHA256:iAzOA1WUAxocdh/WRWXcSg5nw2dJ1aDCvPuT+3ZjkwI
14 changed files with 270 additions and 30 deletions

View File

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1721714663, "lastModified": 1726222338,
"narHash": "sha256-ZDW5+rlROxaOuoEfIQM7Gqhoa+WALEYdYIiZhyJjAu0=", "narHash": "sha256-KuA8ciNR8qCF3dQaCaeh0JWyQUgEwkwDHr/f49Q5/e8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "7560dc942a6fbd37ebd1310b3dbda513de2d4b82", "rev": "503af483e1b328691ea3a434d331995595fb2e3d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -22,11 +22,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1721562059, "lastModified": 1726062873,
"narHash": "sha256-Tybxt65eyOARf285hMHIJ2uul8SULjFZbT9ZaEeUnP8=", "narHash": "sha256-IiA3jfbR7K/B5+9byVi9BZGWTD4VSbWe8VLpp9B/iYk=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "68c9ed8bbed9dfce253cc91560bf9043297ef2fe", "rev": "4f807e8940284ad7925ebd0a0993d2a1791acb2f",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -28,6 +28,8 @@
in in
{ {
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

@ -22,7 +22,6 @@
networking.hostName = "zedd"; # Define your hostname. networking.hostName = "zedd"; # Define your hostname.
networking.networkmanager.enable = true;
time.timeZone = "Europe/Oslo"; time.timeZone = "Europe/Oslo";
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";

View File

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

View File

@ -1,5 +1,13 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
networking.wireless = {
enable = true;
networks = {
"bennynet" = {
pskRaw = "85e8f17e02f4b4df5ddc9b95d1a4256b3c2608fcc8dfa1860b693d06c2a0bf1f";
};
};
};
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; };
@ -15,6 +23,12 @@
intel-media-driver intel-media-driver
intel-vaapi-driver intel-vaapi-driver
libvdpau-va-gl libvdpau-va-gl
rocm-opencl-icd
rocm-opencl-runtime
];
extraPackages32 = with pkgs.pkgsi686Linux; [
intel-media-driver
intel-vaapi-driver
]; ];
}; };
@ -23,11 +37,11 @@
modesetting.enable = true; modesetting.enable = true;
powerManagement.enable = false; powerManagement.enable = false;
powerManagement.finegrained = false; powerManagement.finegrained = false;
open = false; open = true;
nvidiaSettings = true; nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.beta; package = config.boot.kernelPackages.nvidiaPackages.beta;
}; };
pulseaudio.enable = false; pulseaudio.enable = false;
}; };
environment.sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; }; environment.sessionVariables = { LIBVA_DRIVER_NAME = "i965"; };
} }

16
system/nix-alien.nix Normal file
View File

@ -0,0 +1,16 @@
{ ... }:
let
nix-alien-pkgs = import
(
builtins.fetchTarball "https://github.com/thiagokokada/nix-alien/tarball/master"
)
{ };
in
{
environment.systemPackages = with nix-alien-pkgs; [
nix-alien
];
# Optional, but this is needed for `nix-alien-ld` command
programs.nix-ld.enable = true;
}

View File

@ -39,6 +39,7 @@
magicOrExtension = ''\x7fELF....AI\x02''; magicOrExtension = ''\x7fELF....AI\x02'';
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
sipcalc
xdg-utils xdg-utils
pass pass
xdg-desktop-portal xdg-desktop-portal
@ -66,6 +67,8 @@
v4l-utils v4l-utils
nmap nmap
wineWowPackages.stable wineWowPackages.stable
rustc
cargo
]; ];
systemd = { systemd = {

View File

@ -2,6 +2,11 @@
security.rtkit.enable = true; security.rtkit.enable = true;
networking.firewall.enable = false; networking.firewall.enable = false;
services.gnome.gnome-keyring.enable = true;
security.pam.services.i3.enableGnomeKeyring = true;
environment.extraInit = ''
xset s off -dpms
'';
security.polkit.enable = true; security.polkit.enable = true;
services = { services = {
prometheus = { prometheus = {
@ -48,10 +53,11 @@
}; };
logind.extraConfig = "IdleAction=ignore"; logind.extraConfig = "IdleAction=ignore";
xserver = { xserver = {
exportConfiguration = true;
enable = true; enable = true;
xkb.layout = "us,no"; xkb.layout = "us,no";
xkb.variant = "qwerty"; xkb.variant = "qwerty";
xkb.options = "grp:win_space_toggle"; xkb.options = "grp:lalt_lshift_toggle";
desktopManager = { desktopManager = {
xterm.enable = false; xterm.enable = false;
}; };
@ -90,6 +96,7 @@
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 #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

46
user/\ Normal file
View File

@ -0,0 +1,46 @@
{
description = "Benny nixos config flake";
inputs = {
# nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-alien {
url = "github:thiagokokada/nix-alien";
inputs.nixpkgs.follows = "home-manager";
};
}
# ...
# Optional - updates underlying without waiting for nix-citizen to update
};
outputs =
{ self
, nixpkgs
, home-manager
, ...
}@inputs:
let
system = "x86_64-linux";
user = "mbeno";
in
{
nixosConfigurations = {
zedd = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs self user; };
modules = [
({ config, pkgs, ... }: { })
./hosts/zedd
];
};
};
};
}

View File

@ -7,7 +7,7 @@
users.${user} = { pkgs, ... }: { users.${user} = { pkgs, ... }: {
imports = [ imports = [
./programs/neovim ./programs/neovim
./programs/firefox # ./programs/firefox
./programs/tmux ./programs/tmux
./programs/dunst ./programs/dunst
./programs/rofi ./programs/rofi
@ -16,12 +16,12 @@
./programs/games ./programs/games
./scripts ./scripts
./zsh ./zsh
./packages
./ssh ./ssh
./services/ssh-office.nix ./services/ssh-office.nix
./packages
]; ];
tmux.enable = true; tmux.enable = true;
firefox.enable = true; # firefox.enable = true;
xdg.enable = true; xdg.enable = true;
services.picom = { services.picom = {
enable = true; enable = true;

View File

@ -4,17 +4,21 @@
age age
discord discord
jellyfin-media-player jellyfin-media-player
firefox-bin
pdfpc pdfpc
openssl
qpwgraph qpwgraph
mixxx mixxx
imagemagick imagemagick
maim maim
sidequest sidequest
opera opera
direnv
android-studio android-studio
libpng libpng
p7zip p7zip
lshw lshw
powershell
vlc vlc
expat expat
xdeltaUnstable xdeltaUnstable
@ -43,7 +47,6 @@
lutris lutris
pamixer pamixer
pinentry pinentry
pre-commit
pulseaudio pulseaudio
pulsemixer pulsemixer
rbw rbw
@ -87,20 +90,26 @@
typescript typescript
# Py stuff # Py stuff
(python312.withPackages (p: with p; [ (python312.withPackages (
requests p: with p; [
mypy pip
pydantic virtualenv
typer ipython
patool distutils
pyunpack setuptools
ipython mypy
])) pydantic
poetry poetry-core
]
))
ruff ruff
# Rust # Rust
rustup rustc
cargo
gcc
]; ];

View File

@ -133,4 +133,4 @@ element-text, element-icon {
} }
//@theme "/usr/share/rofi/themes/android_notification.rasi" //@theme "/usr/share/rofi/themes/android_notification.rasi"
//@import "/home/mbeno/.config/polybar/hack/scripts/rofi/launcher.rasi" //@import "/home/mbeno/.config/polybar/hack/scripts/rofi/launcher.rasi"
@theme "/nix/store/2dx025n6ndchkdi21d280js9izzkf066-rofi-1.7.5/share/rofi/themes/android_notification.rasi" @theme "${pkgs.rofi-unwrapped}/share/rofi/themes/android_notification.rasi"

View File

@ -1,5 +1,141 @@
{ config, pkgs, ... }: { { config, pkgs, ... }: {
xdg.configFile."rofi/config.rasi" = { xdg.configFile."rofi/config.rasi".text = ''
source = ./config.rasi; /*Dracula theme based on the Purple official rofi theme*/
};
configuration {
show-icons: true;
display-drun: "";
disable-history: false;
}
* {
font: "Jetbrains Mono 12";
foreground: #f8f8f2;
background-color: #282a36;
active-background: #6272a4;
urgent-background: #ff5555;
urgent-foreground: #282a36;
selected-background: @active-background;
selected-urgent-background: @urgent-background;
selected-active-background: @active-background;
separatorcolor: @active-background;
bordercolor: @active-background;
}
#window {
background-color: @background-color;
border: 3;
border-radius: 6;
border-color: @bordercolor;
padding: 15;
}
#mainbox {
border: 0;
padding: 0;
}
#message {
border: 0px;
border-color: @separatorcolor;
padding: 1px;
}
#textbox {
text-color: @foreground;
}
#listview {
fixed-height: 0;
border: 0px;
border-color: @bordercolor;
spacing: 2px ;
scrollbar: false;
padding: 2px 0px 0px ;
}
#element {
border: 0;
padding: 3px ;
}
#element.normal.normal {
background-color: @background-color;
text-color: @foreground;
}
#element.normal.urgent {
background-color: @urgent-background;
text-color: @urgent-foreground;
}
#element.normal.active {
background-color: @active-background;
text-color: @foreground;
}
#element.selected.normal {
background-color: @selected-background;
text-color: @foreground;
}
#element.selected.urgent {
background-color: @selected-urgent-background;
text-color: @foreground;
}
#element.selected.active {
background-color: @selected-active-background;
text-color: @foreground;
}
#element.alternate.normal {
background-color: @background-color;
text-color: @foreground;
}
#element.alternate.urgent {
background-color: @urgent-background;
text-color: @foreground;
}
#element.alternate.active {
background-color: @active-background;
text-color: @foreground;
}
#scrollbar {
width: 2px ;
border: 0;
handle-width: 8px ;
padding: 0;
}
#sidebar {
border: 2px dash 0px 0px ;
border-color: @separatorcolor;
}
#button.selected {
background-color: @selected-background;
text-color: @foreground;
}
#inputbar {
spacing: 0;
text-color: @foreground;
padding: 1px ;
}
#case-indicator {
spacing: 0;
text-color: @foreground;
}
#entry {
spacing: 0;
text-color: @foreground;
}
#prompt {
spacing: 0;
text-color: @foreground;
}
#inputbar {
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
}
#textbox-prompt-colon {
expand: false;
str: ">";
margin: 0px 0.3em 0em 0em ;
text-color: @foreground;
}
element-text, element-icon {
background-color: inherit;
text-color: inherit;
}
//@theme "/usr/share/rofi/themes/android_notification.rasi"
//@import "/home/mbeno/.config/polybar/hack/scripts/rofi/launcher.rasi"
@theme "${pkgs.rofi-unwrapped}/share/rofi/themes/android_notification.rasi"
'';
} }

View File

@ -7,6 +7,12 @@
enableCompletion = true; enableCompletion = true;
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
shellAliases = { shellAliases = {
nclean = ''
sudo nix-channel --update
sudo nix-env -u --always
sudo rm /nix/var/nix/gcroots/auto/*
sudo nix-collect-garbage -d
'';
nrebuild = "nix flake update /home/mbeno/git/nixos && sudo nixos-rebuild switch --recreate-lock-file --flake /home/${user}/git/nixos && nvd diff $(ls -d1v /nix/var/nix/profiles/system-*-link|tail -n 2) && source ~/.zshrc"; nrebuild = "nix flake update /home/mbeno/git/nixos && sudo nixos-rebuild switch --recreate-lock-file --flake /home/${user}/git/nixos && nvd diff $(ls -d1v /nix/var/nix/profiles/system-*-link|tail -n 2) && source ~/.zshrc";
nlog = '' nlog = ''
revpath="/nix/var/nix/profiles"; revpath="/nix/var/nix/profiles";
@ -23,6 +29,8 @@
}; };
initExtra = '' initExtra = ''
set --unexport COLUMNS
set --unexport LINES
bindkey -v bindkey -v
bindkey '^R' history-incremental-search-backward bindkey '^R' history-incremental-search-backward
bindkey '^[[A' history-substring-search-up bindkey '^[[A' history-substring-search-up