Nix #2

Merged
DashieTM merged 23 commits from nix into main 2024-04-22 20:38:46 +02:00
16 changed files with 300 additions and 94 deletions
Showing only changes of commit 850454a6c6 - Show all commits

View file

@ -43,12 +43,13 @@
nssmdns4 = true;
openFirewall = true;
};
services.xserver.desktopManager.gnome.extraGSettingsOverrides = ''
[org.gnome.desktop.interface]
gtk-theme='adw-gtk3'
cursor-theme='Bibata-Modern-Classsic'
cursor-size=24
'';
# services.xserver.desktopManager.gnome.extraGSettingsOverrides = ''
# [org.gnome.desktop.interface]
# gtk-theme='adw-gtk3'
# cursor-theme='Bibata-Modern-Classsic'
# cursor-size=24
# '';
programs.direnv = {
package = pkgs.direnv;
silent = false;

View file

@ -1,27 +1,23 @@
{ pkgs
, ...
}:
{ pkgs, ... }:
let
customKeyboardLayout = pkgs.writeText "us_int" ''
xkb_symbols "us_int"
dashie = pkgs.writeText "dashie" ''
xkb_symbols "dashie"
{
include "us(basic)"
key <AC11> {[ apostrophe, dead_diaeresis, apostrophe, quotedouble ] };
key <TLDE> {[ grave, asciitilde ] };
include "level3(ralt_switch)"
key <AC01> { [ a, A, adiaeresis, Adiaeresis ] };
key <AD09> { [ o, O, odiaeresis, Odiaeresis ] };
key <AD07> { [ u, U, udiaeresis, Udiaeresis ] };
};
'';
compiledLayout = pkgs.runCommand "keyboard-layout" { } ''
${pkgs.xorg.xkbcomp}/bin/xkbcomp ${customKeyboardLayout} $out
'';
in
{
environment.systemPackages = [ pkgs.xorg.xkbcomp ];
services.xserver.xkb.extraLayouts.us_int = {
services.xserver.xkb.extraLayouts.dashie = {
description = "US layout with 'umlaut'";
languages = [ "eng" ];
#symbolsFile = ${customKeyboardLayout};
symbolsFile = /home/dashie/.config/symbols/us_int;
symbolsFile = "${dashie}";
};
#services.xserver.displayManager.sessionCommands = "${pkgs.xorg.xkbcomp}/bin/xkbcomp ${compiledLayout} $DISPLAY";
}

View file

@ -34,7 +34,20 @@
allowUnfree = true;
};
};
default_modules = [
hypr_config = { monitor = [ "" ]; workspace = [ "" ]; };
in
{
# TODO put actual configuration of profiles somewhere else
# TODO: deduplicate
homeConfigurations."marmo" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./hardware/marmo/default.nix ];
};
nixosConfigurations."overheating" = nixpkgs.lib.nixosSystem {
inherit pkgs;
modules = [
./hardware/overheating/default.nix
./base/default.nix
hyprland.nixosModules.default
home-manager.nixosModules.home-manager
@ -56,31 +69,49 @@
hyprland.homeManagerModules.default
anyrun.homeManagerModules.default
ironbar.homeManagerModules.default
./hardware/overheating/base_config.nix
./programs/hyprland/default.nix
nix-flatpak.homeManagerModules.nix-flatpak
./programs/flatpak.nix
];
home-manager.users.dashie.home.stateVersion = "24.05";
}
];
in
{
# TODO put actual configuration of profiles somewhere else
homeConfigurations."marmo" = home-manager.lib.homeManagerConfiguration {
inherit pkgs default_modules;
modules = [ ./hardware/marmo/default.nix ];
};
homeConfigurations."overheating" = home-manager.lib.homeManagerConfiguration {
inherit pkgs default_modules;
modules = [ ./hardware/overheating/default.nix ];
};
nixosConfigurations."spaceship" = nixpkgs.lib.nixosSystem {
inherit pkgs default_modules;
inherit pkgs;
modules = [
./hardware/spaceship/default.nix
./hardware/streamdeck.nix
./programs/gaming/default.nix
./base/default.nix
hyprland.nixosModules.default
home-manager.nixosModules.home-manager
{
xdg.portal.config.common.default = "*";
xdg.portal = {
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-hyprland
pkgs.xdg-desktop-portal-gtk
];
};
home-manager.useGlobalPkgs = true;
home-manager.users.dashie.imports = [
{
_module = { args = { inherit self inputs; }; };
}
./programs/default.nix
hyprland.homeManagerModules.default
anyrun.homeManagerModules.default
ironbar.homeManagerModules.default
./hardware/spaceship/base_config.nix
./programs/hyprland/default.nix
nix-flatpak.homeManagerModules.nix-flatpak
./programs/flatpak.nix
];
home-manager.users.dashie.home.stateVersion = "24.05";
}
];
};
};

View file

@ -0,0 +1,13 @@
{ lib, config, ... }: {
imports = [
../../modules/ironbar_config.nix
];
wayland.windowManager.hyprland.settings.monitor = [
# default
"eDP-1,2944x1840@90,0x0,2"
# all others
",highrr,auto,1"
];
programs.ironbar.monitor = "eDP-1";
}

View file

@ -1 +1,78 @@
{}
{ pkgs, ... }:
{
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
# WARNING: Simply change this for each config
networking.hostName = "overheating";
# Enable networking
networking.networkmanager.enable = true;
services.flatpak.enable = true;
# Set your time zone.
time.timeZone = "Europe/Zurich";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# Enable the X11 windowing system.
services.xserver.enable = true;
# Configure keymap in X11
services.xserver = {
xkb.layout = "us";
xkb.variant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
environment.variables = {
XDG_CACHE_HOME = "$HOME/.cache";
DIRENV_LOG_FORMAT = "";
};
# allows user change later on
users.mutableUsers = true;
users.users.dashie = {
isNormalUser = true;
description = "dashie";
extraGroups = [ "networkmanager" "wheel" "gamemode" ];
packages = with pkgs; [
home-manager
xdg-desktop-portal-gtk
xdg-desktop-portal-hyprland
];
# this password will only last for the first login
# e.g. login, then change to whatever else, this also ensures no public hash is available
password = "firstlogin";
};
nix.settings = {
builders-use-substitutes = true;
# substituters to use
substituters = [
"https://anyrun.cachix.org"
];
trusted-public-keys = [
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
];
};
system.stateVersion = "unstable";
}

View file

@ -1 +1,57 @@
{ config, lib, pkgs, modulesPath, ... }: { }
{ config, lib, modulesPath, ... }:
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [
"noatime"
"nodiratime"
"discard"
];
};
fileSystems."/boot" =
{
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
options = [ "rw" "fmask=0022" "dmask=0022" "noatime" ];
};
fileSystems."/home" =
{
device = "/dev/disk/by-label/HOME";
fsType = "btrfs";
options = [
"noatime"
"nodiratime"
"discard"
];
};
swapDevices =
[{ device = "/dev/disk/by-label/SWAP"; }];
# 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.enp15s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp16s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
services.fstrim.enable = lib.mkDefault true;
nix.settings.auto-optimise-store = true;
}

View file

@ -0,0 +1,34 @@
{config, ...}:{
imports = [
../../modules/ironbar_config.nix
];
wayland.windowManager.hyprland.settings.monitor = [
# default
"DP-2,2560x1440@165,0x0,1"
"DP-1,3440x1440@180,2560x0,1"
"HDMI-A-1,1920x1200@60,6000x0,1"
"HDMI-A-1,transform,1"
# all others
",highrr,auto,1"
];
wayland.windowManager.hyprland.settings.workspace = [
# workspaces
# monitor middle
"2,monitor:DP-1, default:true"
"4,monitor:DP-1"
"6,monitor:DP-1"
"8,monitor:DP-1"
"9,monitor:DP-1"
"10,monitor:DP-1"
# monitor left
"1,monitor:DP-2, default:true"
"5,monitor:DP-2"
"7,monitor:DP-2"
# monitor right
"3,monitor:HDMI-A-1, default:true"
];
programs.monitor = "DP-1";
}

View file

@ -45,7 +45,7 @@
pulse.enable = true;
};
environment.variables = rec {
environment.variables = {
XDG_CACHE_HOME = "$HOME/.cache";
DIRENV_LOG_FORMAT = "";
};

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, modulesPath, ... }:
{ config, lib, modulesPath, ... }:
{
imports =
[

View file

@ -0,0 +1,12 @@
{ lib, ... }: {
options.programs.ironbar = {
monitor = lib.mkOption {
default = "";
example = "eDP-1";
type = lib.types.str;
description = ''
Extra settings for foo.
'';
};
};
}

View file

@ -55,6 +55,14 @@
filesystems=xdg-config/gtk-3.0;xdg-config/gtk-4.0
'';
dconf.settings = {
"org/gnome/desktop/interface" = {
gtk-theme = "adw-gtk3";
cursor-theme = "Bibata-Modern-Classic";
cursor-size = 24;
};
};
programs.nix-index =
{
enable = true;

View file

@ -148,7 +148,7 @@
};
input = {
kb_layout = "us_int";
kb_layout = "dashie";
repeat_delay = 200;
force_no_accel = true;
touchpad = {
@ -169,6 +169,10 @@
enable_hyprcursor = false;
};
gestures = {
workspace_swipe = true;
};
env = [
"GTK_CSD,0"
"TERM,\"kitty /bin/fish\""
@ -190,37 +194,6 @@
"GTK_USE_PORTAL, 1"
];
monitor = [
# default
"DP-2,2560x1440@165,0x0,1"
"DP-1,3440x1440@180,2560x0,1"
"HDMI-A-1,1920x1200@60,6000x0,1"
"HDMI-A-1,transform,1"
# all others
",highrr,auto,1"
];
workspace = [
# workspaces
# monitor middle
"2,monitor:DP-1, default:true"
"4,monitor:DP-1"
"6,monitor:DP-1"
"8,monitor:DP-1"
"9,monitor:DP-1"
"10,monitor:DP-1"
# monitor left
"1,monitor:DP-2, default:true"
"5,monitor:DP-2"
"7,monitor:DP-2"
# monitor right
"3,monitor:HDMI-A-1, default:true"
];
layerrule = [
# layer rules
# mainly to disable animations within slurp and grim

View file

@ -1,17 +1,18 @@
{
xdg.configFile."hypr/hyprpaper.conf" = {
text =
''
#load
preload = /home/dashie/Pictures/backgrounds/shinobu_2k.jpg
preload = /home/dashie/Pictures/backgrounds/shino_wide.png
preload = /home/dashie/Pictures/backgrounds/shinobu_1200.jpg
#set
wallpaper = DP-2,/home/dashie/Pictures/backgrounds/shinobu_2k.jpg
wallpaper = DP-1,/home/dashie/Pictures/backgrounds/shino_wide.png
wallpaper = HDMI-A-1,/home/dashie/Pictures/backgrounds/shinobu_1200.jpg
splash = true
'';
};
}
#{
# xdg.configFile."hypr/hyprpaper.conf" = {
# text =
# ''
# #load
# preload = /home/dashie/Pictures/backgrounds/shinobu_2k.jpg
# preload = /home/dashie/Pictures/backgrounds/shino_wide.png
# preload = /home/dashie/Pictures/backgrounds/shinobu_1200.jpg
#
# #set
# wallpaper = DP-2,/home/dashie/Pictures/backgrounds/shinobu_2k.jpg
# wallpaper = DP-1,/home/dashie/Pictures/backgrounds/shino_wide.png
# wallpaper = HDMI-A-1,/home/dashie/Pictures/backgrounds/shinobu_1200.jpg
# splash = true
# '';
# };
#}
{}

View file

@ -1,5 +1,7 @@
{config, ...}:{
programs.ironbar =
{
programs.ironbar = {
enable = true;
style = ''
@import url("/home/dashie/.config/gtk-3.0/gtk.css");
@ -139,7 +141,7 @@
#"another_feature"
];
config = {
monitors.DP-1 = {
monitors."${config.programs.ironbar.monitor}" = {
end = [
{
type = "sys_info";

View file

@ -1,3 +1,5 @@
{config, ...}:
let
browser = [ "firefox.desktop" ];