format code

current_state
Christian Ott 1 year ago
parent 44e64ef028
commit 73e71df821
  1. 56
      configuration.nix
  2. 66
      disko.nix
  3. 25
      flake.nix
  4. 10
      greeter.nix
  5. 21
      hardware-configuration.nix
  6. 27
      home.nix
  7. 28
      hyperland/default.nix
  8. 5
      modules/dunst.nix
  9. 8
      modules/ranger.nix
  10. 56
      modules/waybar.nix

@ -2,16 +2,25 @@
# your system. Help is available in the configuration.nix(5) man page, 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`). # https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ronema, xdph, ... }: {
config,
lib,
pkgs,
ronema,
xdph,
...
}:
{ {
imports = imports = [
[ # Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
"${builtins.fetchTarball { "${
builtins.fetchTarball {
url = "https://github.com/nix-community/disko/archive/refs/tags/v1.6.1.tar.gz"; url = "https://github.com/nix-community/disko/archive/refs/tags/v1.6.1.tar.gz";
sha256 = "1p9vsml07bm3riw703dv83ihlmgyc11qv882qa6bqzqdgn86y8z4"; sha256 = "1p9vsml07bm3riw703dv83ihlmgyc11qv882qa6bqzqdgn86y8z4";
}}/module.nix" }
}/module.nix"
./disko.nix ./disko.nix
]; ];
@ -55,16 +64,21 @@
# }; # };
# https://nixos.wiki/wiki/Fonts fonts with icons # https://nixos.wiki/wiki/Fonts fonts with icons
fonts.packages = with pkgs; fonts.packages = with pkgs; [
[
font-awesome font-awesome
(nerdfonts.override {fonts = ["JetBrainsMono" "CascadiaCode" "FiraCode"];}) (nerdfonts.override {
fonts = [
"JetBrainsMono"
"CascadiaCode"
"FiraCode"
];
})
]; ];
fonts.fontconfig = { fonts.fontconfig = {
defaultFonts = { defaultFonts = {
monospace = ["CaskaydiaCove Nerd Font Mono"]; monospace = [ "CaskaydiaCove Nerd Font Mono" ];
sansSerif = ["CascadiaCode Nerd Font"]; sansSerif = [ "CascadiaCode Nerd Font" ];
serif = ["CascadiaCode Nerd Font"]; serif = [ "CascadiaCode Nerd Font" ];
}; };
}; };
@ -126,7 +140,11 @@
# Define a user account. Don't forget to set a password with ‘passwd’. # Define a user account. Don't forget to set a password with ‘passwd’.
users.users.chrigi = { users.users.chrigi = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "docker"]; extraGroups = [
"wheel"
"networkmanager"
"docker"
];
initialPassword = "password"; initialPassword = "password";
packages = with pkgs; [ packages = with pkgs; [
firefox firefox
@ -176,14 +194,18 @@
}; };
programs._1password-gui = { programs._1password-gui = {
enable = true; enable = true;
polkitPolicyOwners = ["chrigi"]; polkitPolicyOwners = [ "chrigi" ];
}; };
security.polkit.enable = true; security.polkit.enable = true;
services.gnome.gnome-keyring.enable = true; services.gnome.gnome-keyring.enable = true;
security.pam.services.greetd.enableGnomeKeyring = true; security.pam.services.greetd.enableGnomeKeyring = true;
nix.gc = { automatic = true; dates = "weekly"; options = "--delete-older-than 7d"; }; nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
# Some programs need SUID wrappers, can be configured further or are # Some programs need SUID wrappers, can be configured further or are
# started in user sessions. # started in user sessions.
@ -229,8 +251,10 @@
nix = { nix = {
# package = pkgs.nix; # package = pkgs.nix;
settings.experimental-features = ["nix-command" "flakes"]; settings.experimental-features = [
"nix-command"
"flakes"
];
}; };
} }

@ -30,9 +30,17 @@
bypassWorkqueues = true; bypassWorkqueues = true;
keyFile = "/tmp/yk/yk_mini.key"; keyFile = "/tmp/yk/yk_mini.key";
}; };
additionalKeyFiles = [ "/tmp/yk/yk_the_big_one.key" "/tmp/yk/yk_on_key.key" "/tmp/yk/yk_round.key" ]; additionalKeyFiles = [
"/tmp/yk/yk_the_big_one.key"
"/tmp/yk/yk_on_key.key"
"/tmp/yk/yk_round.key"
];
# https://github.com/sgillespie/nixos-yubikey-luks # https://github.com/sgillespie/nixos-yubikey-luks
extraFormatArgs = [ "--cipher=aes-xts-plain64" "--key-size=512" "--hash=sha512" ]; extraFormatArgs = [
"--cipher=aes-xts-plain64"
"--key-size=512"
"--hash=sha512"
];
initrdUnlock = false; # we have to add it manually because of the yubikeys initrdUnlock = false; # we have to add it manually because of the yubikeys
content = { content = {
type = "btrfs"; type = "btrfs";
@ -41,23 +49,48 @@
"/root" = { "/root" = {
mountpoint = "/"; mountpoint = "/";
# https://unix.stackexchange.com/questions/752741/what-is-the-mount-option-space-cache-v2 # https://unix.stackexchange.com/questions/752741/what-is-the-mount-option-space-cache-v2
mountOptions = [ "compress=zstd" "noatime" "space_cache=v2" "commit=120"]; mountOptions = [
"compress=zstd"
"noatime"
"space_cache=v2"
"commit=120"
];
}; };
"/home" = { "/home" = {
mountpoint = "/home"; mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" "space_cache=v2" "commit=120"]; mountOptions = [
"compress=zstd"
"noatime"
"space_cache=v2"
"commit=120"
];
}; };
"/nix" = { "/nix" = {
mountpoint = "/nix"; mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" "space_cache=v2" "commit=120"]; mountOptions = [
"compress=zstd"
"noatime"
"space_cache=v2"
"commit=120"
];
}; };
"/var" = { "/var" = {
mountpoint = "/var"; mountpoint = "/var";
mountOptions = [ "compress=zstd" "noatime" "space_cache=v2" "commit=120"]; mountOptions = [
"compress=zstd"
"noatime"
"space_cache=v2"
"commit=120"
];
}; };
"/docker-btrfs" = { "/docker-btrfs" = {
mountpoint = "/var/lib/docker/btrfs"; mountpoint = "/var/lib/docker/btrfs";
mountOptions = [ "compress=zstd" "noatime" "space_cache=v2" "commit=120"]; mountOptions = [
"compress=zstd"
"noatime"
"space_cache=v2"
"commit=120"
];
}; };
}; };
}; };
@ -91,8 +124,16 @@
bypassWorkqueues = true; bypassWorkqueues = true;
keyFile = "/tmp/yk/yk_mini.key"; keyFile = "/tmp/yk/yk_mini.key";
}; };
additionalKeyFiles = [ "/tmp/yk/yk_the_big_one.key" "/tmp/yk/yk_on_key.key" "/tmp/yk/yk_round.key" ]; additionalKeyFiles = [
extraFormatArgs = [ "--cipher=aes-xts-plain64" "--key-size=512" "--hash=sha512" ]; "/tmp/yk/yk_the_big_one.key"
"/tmp/yk/yk_on_key.key"
"/tmp/yk/yk_round.key"
];
extraFormatArgs = [
"--cipher=aes-xts-plain64"
"--key-size=512"
"--hash=sha512"
];
initrdUnlock = false; # we have to add it manually because of the yubikeys initrdUnlock = false; # we have to add it manually because of the yubikeys
content = { content = {
type = "btrfs"; type = "btrfs";
@ -100,7 +141,12 @@
subvolumes = { subvolumes = {
"/backup" = { "/backup" = {
mountpoint = "/backup"; mountpoint = "/backup";
mountOptions = [ "compress=zstd" "noatime" "space_cache=v2" "commit=120"]; mountOptions = [
"compress=zstd"
"noatime"
"space_cache=v2"
"commit=120"
];
}; };
}; };
}; };

@ -10,7 +10,7 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
home-manager = { home-manager = {
url = github:nix-community/home-manager; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
ronema = { ronema = {
@ -19,7 +19,17 @@
}; };
}; };
outputs = { self, nixpkgs, nixos-hardware, home-manager, nix-colors, ronema, xdph, ... }@inputs: outputs =
{
self,
nixpkgs,
nixos-hardware,
home-manager,
nix-colors,
ronema,
xdph,
...
}@inputs:
let let
username = "chrigi"; username = "chrigi";
lib = nixpkgs.lib; lib = nixpkgs.lib;
@ -29,7 +39,8 @@
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
}; };
in { in
{
nixosConfigurations.nix-fw16 = lib.nixosSystem { nixosConfigurations.nix-fw16 = lib.nixosSystem {
specialArgs = { specialArgs = {
inherit pkgs ronema xdph; inherit pkgs ronema xdph;
@ -38,14 +49,16 @@
./configuration.nix ./configuration.nix
./greeter.nix ./greeter.nix
nixos-hardware.nixosModules.framework-16-7040-amd nixos-hardware.nixosModules.framework-16-7040-amd
home-manager.nixosModules.home-manager { home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.${username} = import ./home.nix; home-manager.users.${username} = import ./home.nix;
home-manager.extraSpecialArgs = {inherit username nix-colors; }; home-manager.extraSpecialArgs = {
inherit username nix-colors;
};
} }
]; ];
}; };
}; };
} }

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet"; tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet";
@ -16,7 +21,8 @@ let
terminal = true; terminal = true;
}; };
in { in
{
services.greetd = { services.greetd = {
enable = true; enable = true;

@ -1,18 +1,29 @@
# 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,
...
}:
{ {
disabledModules = ["system/boot/luksroot.nix"]; disabledModules = [ "system/boot/luksroot.nix" ];
imports = imports = [
[ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
./my-luksroot.nix ./my-luksroot.nix
]; ];
boot.initrd = { boot.initrd = {
kernelModules = ["vfat" "nls_cp437" "nls_iso8859-1" "usbhid"]; kernelModules = [
"vfat"
"nls_cp437"
"nls_iso8859-1"
"usbhid"
];
luks = { luks = {
yubikeySupport = true; yubikeySupport = true;

@ -1,4 +1,10 @@
{ config, pkgs, nix-colors, username, ... }: {
config,
pkgs,
nix-colors,
username,
...
}:
{ {
imports = [ imports = [
@ -14,7 +20,6 @@
home.username = "${username}"; home.username = "${username}";
home.homeDirectory = "/home/${username}"; home.homeDirectory = "/home/${username}";
# Packages that should be installed to the user profile. # Packages that should be installed to the user profile.
home.packages = with pkgs; [ home.packages = with pkgs; [
kitty kitty
@ -42,10 +47,15 @@
nextcloud-client nextcloud-client
font-awesome font-awesome
(nerdfonts.override {fonts = ["JetBrainsMono" "CascadiaCode" "FiraCode"];}) (nerdfonts.override {
fonts = [
"JetBrainsMono"
"CascadiaCode"
"FiraCode"
]; ];
})
];
programs.ssh = { programs.ssh = {
enable = true; enable = true;
@ -62,7 +72,13 @@
programs.bash = { programs.bash = {
enable = true; enable = true;
historyIgnore = [ "l" "ls" "ll" "cd" "exit" ]; historyIgnore = [
"l"
"ls"
"ll"
"cd"
"exit"
];
historyControl = [ "erasedups" ]; historyControl = [ "erasedups" ];
shellAliases = { shellAliases = {
grep = "grep --color=auto"; grep = "grep --color=auto";
@ -81,7 +97,6 @@
''; '';
}; };
programs.starship = { programs.starship = {
enable = true; enable = true;
enableBashIntegration = true; enableBashIntegration = true;

@ -1,4 +1,9 @@
{ config, pkgs, username, ... }: {
config,
pkgs,
username,
...
}:
let let
volumeChange = pkgs.writeShellScript "volume-change" '' volumeChange = pkgs.writeShellScript "volume-change" ''
# FROM: https://github.com/jsimonrichard/nix-config/blob/master/modules/my-config/desktop/hyprland/home-manager/desktop/hyprland/keybinds.nix # FROM: https://github.com/jsimonrichard/nix-config/blob/master/modules/my-config/desktop/hyprland/home-manager/desktop/hyprland/keybinds.nix
@ -62,7 +67,7 @@ in
blur_passes = 1; blur_passes = 1;
blur_size = 7; blur_size = 7;
noise = 0.0117; noise = 1.17e-2;
contrast = 0.8916; contrast = 0.8916;
brightness = 0.8172; brightness = 0.8172;
vibrancy = 0.1696; vibrancy = 0.1696;
@ -177,7 +182,7 @@ in
wayland.windowManager.hyprland.enable = true; wayland.windowManager.hyprland.enable = true;
wayland.windowManager.hyprland.settings = { wayland.windowManager.hyprland.settings = {
monitor=[ monitor = [
"eDP-1,2560x1600@60.00Hz,0x0,1" "eDP-1,2560x1600@60.00Hz,0x0,1"
"DP-3,preferred,-3840x-560,1" "DP-3,preferred,-3840x-560,1"
"DP-2,preferred,auto,1.5" "DP-2,preferred,auto,1.5"
@ -204,7 +209,6 @@ in
"$mod, mouse:273, resizewindow" "$mod, mouse:273, resizewindow"
]; ];
bind = bind =
[ [
"$mod, F, exec, firefox" "$mod, F, exec, firefox"
@ -222,20 +226,24 @@ in
++ ( ++ (
# workspaces # workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10} # binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
builtins.concatLists (builtins.genList ( builtins.concatLists (
x: let builtins.genList (
ws = let x:
let
ws =
let
c = (x + 1) / 10; c = (x + 1) / 10;
in in
builtins.toString (x + 1 - (c * 10)); builtins.toString (x + 1 - (c * 10));
in [ in
[
"$mod, ${ws}, workspace, ${toString (x + 1)}" "$mod, ${ws}, workspace, ${toString (x + 1)}"
"$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
] ]
) 10
) )
10)
); );
windowrulev2= [ windowrulev2 = [
# https://jbmorley.co.uk/posts/2024-02-13-1password-and-hyprland/ # https://jbmorley.co.uk/posts/2024-02-13-1password-and-hyprland/
"float, title:(1Password)" "float, title:(1Password)"
"size 70% 70%, title:(1Password)" "size 70% 70%, title:(1Password)"

@ -2,7 +2,8 @@
inputs, inputs,
config, config,
... ...
}:{ }:
{
services.dunst = { services.dunst = {
enable = true; enable = true;
settings = { settings = {
@ -54,7 +55,7 @@
title = "Dunst"; title = "Dunst";
class = "Dunst"; class = "Dunst";
corner_radius = 10; corner_radius = 10;
icon_corner_radius= 5; icon_corner_radius = 5;
notification_limit = 5; notification_limit = 5;
mouse_left_click = "close_current"; mouse_left_click = "close_current";
mouse_middle_click = "do_action"; mouse_middle_click = "do_action";

@ -1,4 +1,4 @@
{pkgs, ...}: { pkgs, ... }:
{ {
# stolen from: https://github.com/leoperegrino/.files/blob/d996b31a0b1843f05d0f27123196bfa6d0980caa/home-manager/modules/ranger.nix # stolen from: https://github.com/leoperegrino/.files/blob/d996b31a0b1843f05d0f27123196bfa6d0980caa/home-manager/modules/ranger.nix
programs.ranger = { programs.ranger = {
@ -7,13 +7,15 @@
pkgs.ueberzugpp pkgs.ueberzugpp
]; ];
extraConfig = "default_linemode devicons"; extraConfig = "default_linemode devicons";
plugins = [{ plugins = [
{
name = "devicons"; name = "devicons";
src = builtins.fetchGit { src = builtins.fetchGit {
url = "https://github.com/alexanderjeurissen/ranger_devicons.git"; url = "https://github.com/alexanderjeurissen/ranger_devicons.git";
rev = "a8d626485ca83719e1d8d5e32289cd96a097c861"; rev = "a8d626485ca83719e1d8d5e32289cd96a097c861";
}; };
}]; }
];
settings = { settings = {
preview_images_method = "ueberzug"; preview_images_method = "ueberzug";
show_hidden = true; show_hidden = true;

@ -2,8 +2,9 @@
config, config,
pkgs, pkgs,
... ...
}: { }:
programs.waybar = { {
programs.waybar = {
enable = true; enable = true;
package = pkgs.waybar; package = pkgs.waybar;
settings = { settings = {
@ -43,15 +44,15 @@ programs.waybar = {
default = "󰍹"; default = "󰍹";
}; };
persistent-workspaces = { persistent-workspaces = {
"1" = []; "1" = [ ];
"2" = []; "2" = [ ];
"3" = []; "3" = [ ];
"4" = []; "4" = [ ];
"5" = []; "5" = [ ];
"6" = []; "6" = [ ];
"7" = []; "7" = [ ];
"8" = []; "8" = [ ];
"9" = []; "9" = [ ];
}; };
}; };
"hyprland/language" = { "hyprland/language" = {
@ -93,7 +94,18 @@ programs.waybar = {
format = "{icon}"; format = "{icon}";
tooltip = true; tooltip = true;
format-alt = "<small>{percent}%</small>"; format-alt = "<small>{percent}%</small>";
format-icons = ["󱩎" "󱩏" "󱩐" "󱩑" "󱩒" "󱩓" "󱩔" "󱩕" "󱩖" "󰛨"]; format-icons = [
"󱩎"
"󱩏"
"󱩐"
"󱩑"
"󱩒"
"󱩓"
"󱩔"
"󱩕"
"󱩖"
"󰛨"
];
# on-scroll-up = "brightnessctl set 1%+"; # on-scroll-up = "brightnessctl set 1%+";
# on-scroll-down = "brightnessctl set 1%-"; # on-scroll-down = "brightnessctl set 1%-";
# smooth-scrolling-threshold = "2400"; # smooth-scrolling-threshold = "2400";
@ -108,7 +120,13 @@ programs.waybar = {
tooltip-format = "{essid}"; tooltip-format = "{essid}";
interval = 1; interval = 1;
on-click = "ronema"; on-click = "ronema";
format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"]; format-icons = [
"󰤯"
"󰤟"
"󰤢"
"󰤥"
"󰤨"
];
}; };
"bluetooth" = { "bluetooth" = {
@ -130,7 +148,11 @@ programs.waybar = {
format-icons = { format-icons = {
headphone = ""; headphone = "";
default = ["" "" "󰕾"]; default = [
""
""
"󰕾"
];
}; };
# on-click = "pamixer -t"; # on-click = "pamixer -t";
# on-scroll-up = "pamixer -i 1"; # on-scroll-up = "pamixer -i 1";
@ -157,7 +179,11 @@ programs.waybar = {
format-full = "󰂄"; format-full = "󰂄";
format-alt = "<small>{capacity}%</small> "; format-alt = "<small>{capacity}%</small> ";
format-icons = ["󱊡" "󱊢" "󱊣"]; format-icons = [
"󱊡"
"󱊢"
"󱊣"
];
}; };
# "custom/weather" = { # "custom/weather" = {

Loading…
Cancel
Save

Powered by TurnKey Linux.