Compare commits

..

No commits in common. "03c95b7b6f71e8a87358ddb49590caa2f246d846" and "1e0e83b9340129939e2516fa62da5e3cb5a9badc" have entirely different histories.

40 changed files with 446 additions and 821 deletions

16
flake.lock generated
View File

@ -7,16 +7,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1717527182, "lastModified": 1710888565,
"narHash": "sha256-vWSkg6AMok1UUQiSYVdGMOXKD2cDFnajITiSi0Zjd1A=", "narHash": "sha256-s9Hi4RHhc6yut4EcYD50sZWRDKsugBJHSbON8KFwoTw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "845a5c4c073f74105022533907703441e0464bc3", "rev": "f33900124c23c4eca5831b9b5eb32ea5894375ce",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-24.05", "ref": "release-23.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@ -73,16 +73,16 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1718086528, "lastModified": 1715668745,
"narHash": "sha256-hoB7B7oPgypePz16cKWawPfhVvMSXj4G/qLsfFuhFjw=", "narHash": "sha256-xp62OkRkbUDNUc6VSqH02jB0FbOS+MsfMb7wL1RJOfA=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "47b604b07d1e8146d5398b42d3306fdebd343986", "rev": "9ddcaffecdf098822d944d4147dd8da30b4e6843",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-24.05", "ref": "nixos-23.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View File

@ -2,12 +2,12 @@
description = "Nixos config flake"; description = "Nixos config flake";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
unstable.url = "github:nixos/nixpkgs/nixos-unstable"; unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-24.05"; url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };

View File

@ -10,22 +10,96 @@
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
../../modules/nixos # script for rebuilding nixos
../../modules/nixos/rebuild.nix
../../modules/nixos/wifi.nix
../../modules/nixos/sops.nix
# greetd login manager
../../modules/nixos/greetd.nix
# sway as window manager
../../modules/nixos/sway.nix
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
]; ];
myConfig = { hardware.opengl = {
enable = true; enable = true;
desktop = true; extraPackages = with pkgs; [
gpu.amd.enable = true; libvdpau-va-gl
laptop = true; libvdpau
libva
rocmPackages.clr.icd
amdvlk
driversi686Linux.amdvlk
];
}; };
hardware.spacenavd.enable = true;
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "MaxNixosLaptop"; # Define your hostname. networking.hostName = "MaxNixosLaptop"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
# networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Berlin";
# NIXOS # NIXOS
nix.settings.experimental-features = ["nix-command" "flakes"]; nix.settings.experimental-features = ["nix-command" "flakes"];
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
# Configure console keymap
console.keyMap = "de";
# Enable CUPS to print documents.
services.printing = {
enable = true;
drivers = [pkgs.samsung-unified-linux-driver];
};
services.avahi = {
enable = true;
nssmdns = true;
openFirewall = true;
};
hardware.printers = {
ensurePrinters = [
{
name = "Samsung_ML-1630W_Series";
location = "luhbots";
deviceUri = "dnssd://Samsung%20ML-1630W%20Series%20(SEC00159937E684)._pdl-datastream._tcp.local/";
model = "samsung/ML-1630W.ppd";
ppdOptions = {
PageSize = "A4";
};
}
];
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# 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.max = { users.users.max = {
isNormalUser = true; isNormalUser = true;
@ -150,6 +224,8 @@
''; '';
}; };
services.flatpak.enable = true;
services.pipewire = { services.pipewire = {
enable = true; enable = true;
alsa.enable = true; alsa.enable = true;

View File

@ -3,11 +3,12 @@
../../modules/home ../../modules/home
]; ];
myConfig = { shell.enable = true;
enable = true; git.enable = true;
desktop = true; music.enable = true;
laptop = true; sway.enable = true;
}; sway.laptop = true;
myPrograms.enable = true;
# Home Manager needs a bit of information about you and the paths it should # Home Manager needs a bit of information about you and the paths it should
# manage. # manage.
@ -22,4 +23,15 @@
# want to update the value, then make sure to first check the Home Manager # want to update the value, then make sure to first check the Home Manager
# release notes. # release notes.
home.stateVersion = "23.11"; # Please read the comment before changing. home.stateVersion = "23.11"; # Please read the comment before changing.
xdg.enable = true;
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
programs.direnv = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
} }

View File

@ -1,33 +1,3 @@
{ {...}: {
lib,
config,
...
}: let
cfg = config.myConfig;
in {
imports = [./git ./music ./programs ./shell ./sway]; imports = [./git ./music ./programs ./shell ./sway];
options.myConfig = {
enable = lib.mkEnableOption "custom home-manager config";
desktop = lib.mkEnableOption "custom home-manager config for desktop use";
laptop = lib.mkEnableOption "extra settings for laptop use";
};
config = lib.mkIf cfg.enable {
myConfig = {
shell.enable = true;
git.enable = true;
sway.enable = lib.mkIf cfg.desktop true;
music.enable = lib.mkIf cfg.desktop true;
programs.enable = lib.mkIf cfg.desktop true;
sway.laptop = lib.mkIf cfg.laptop true;
};
xdg.enable = true;
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
};
} }

View File

@ -3,16 +3,16 @@
config, config,
... ...
}: let }: let
cfg = config.myConfig.git; cfg = config.git;
in { in {
imports = [./lazygit.nix]; imports = [./lazygit.nix];
options.myConfig.git = { options = {
enable = lib.mkEnableOption "git"; git.enable = lib.mkEnableOption "git";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
myConfig.git.lazygit.enable = lib.mkDefault true; git.lazygit.enable = lib.mkDefault true;
programs.git = { programs.git = {
enable = true; enable = true;

View File

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myConfig.git.lazygit; cfg = config.git.lazygit;
in { in {
options.myConfig.git.lazygit = { options = {
enable = lib.mkEnableOption "lazygit, a git tui"; git.lazygit.enable = lib.mkEnableOption "lazygit, a git tui";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -4,15 +4,15 @@
inputs, inputs,
... ...
}: let }: let
cfg = config.myConfig.music; cfg = config.music;
in { in {
imports = [./mpd.nix]; imports = [./mpd.nix];
options.myConfig.music = { options = {
enable = lib.mkEnableOption "make the system ready for listening to music"; music.enable = lib.mkEnableOption "make the system ready for listening to music";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
myConfig.music.mpd.enable = lib.mkDefault true; music.mpd.enable = lib.mkDefault true;
}; };
} }

View File

@ -4,10 +4,10 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.myConfig.music.mpd; cfg = config.music.mpd;
in { in {
options.myConfig.music.mpd = { options = {
enable = lib.mkEnableOption "Music Player Daemon"; music.mpd.enable = lib.mkEnableOption "Music Player Daemon";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -4,21 +4,19 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.myConfig.programs; cfg = config.myPrograms;
in { in {
imports = [./foot.nix ./thunderbird.nix ./nextcloud.nix ./udiskie.nix]; imports = [./foot.nix ./thunderbird.nix ./nextcloud.nix ./udiskie.nix];
options.myConfig.programs = { options = {
enable = lib.mkEnableOption "programs for desktop use"; myPrograms.enable = lib.mkEnableOption "programs for desktop use";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
myConfig.programs = { myPrograms.foot.enable = lib.mkDefault true;
foot.enable = lib.mkDefault true; myPrograms.thunderbird.enable = lib.mkDefault true;
thunderbird.enable = lib.mkDefault true; myPrograms.nextcloud.enable = lib.mkDefault true;
nextcloud.enable = lib.mkDefault true; myPrograms.udiskie.enable = lib.mkDefault true;
udiskie.enable = lib.mkDefault true;
};
home.packages = with pkgs; [ home.packages = with pkgs; [
unzip unzip
@ -45,9 +43,8 @@ in {
freecad freecad
flatpak flatpak
wine wine
gyroflow unstable.gyroflow
prusa-slicer prusa-slicer
kicad
]; ];
}; };
} }

View File

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myConfig.programs.foot; cfg = config.myPrograms.foot;
in { in {
options.myConfig.programs.foot = { options = {
enable = lib.mkEnableOption "foot, a lightweight wayland terminal emulator"; myPrograms.foot.enable = lib.mkEnableOption "foot, a lightweight wayland terminal emulator";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myConfig.programs.nextcloud; cfg = config.myPrograms.nextcloud;
in { in {
options.myConfig.programs.nextcloud = { options = {
enable = lib.mkEnableOption "nextcloud client"; myPrograms.nextcloud.enable = lib.mkEnableOption "nextcloud client";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myConfig.programs.thunderbird; cfg = config.myPrograms.thunderbird;
in { in {
options.myConfig.programs.thunderbird = { options = {
enable = lib.mkEnableOption "thunderbird, a email client"; myPrograms.thunderbird.enable = lib.mkEnableOption "thunderbird, a email client";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myConfig.programs.udiskie; cfg = config.myPrograms.udiskie;
in { in {
options.myConfig.programs.udiskie = { options = {
enable = lib.mkEnableOption "auto media mounting"; myPrograms.udiskie.enable = lib.mkEnableOption "auto media mounting";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myConfig.shell.bat; cfg = config.shell.bat;
in { in {
options.myConfig.shell.bat = { options = {
enable = lib.mkEnableOption "bat, a cat replacement with syntax highlighting"; shell.bat.enable = lib.mkEnableOption "bat, a cat replacement with syntax highlighting";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -4,10 +4,10 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.myConfig.shell.btop; cfg = config.shell.btop;
in { in {
options.myConfig.shell.btop = { options = {
enable = lib.mkEnableOption "btop, a system monitor"; shell.btop.enable = lib.mkEnableOption "btop, a system monitor";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -3,21 +3,18 @@
config, config,
... ...
}: let }: let
cfg = config.myConfig.shell; cfg = config.shell;
in { in {
imports = [./zsh.nix ./bat.nix ./btop.nix ./neovim.nix ./direnv.nix]; imports = [./zsh.nix ./bat.nix ./btop.nix ./neovim.nix];
options.myConfig.shell = { options = {
enable = lib.mkEnableOption "my shell environment"; shell.enable = lib.mkEnableOption "my shell environment";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
myConfig.shell = { shell.zsh.enable = lib.mkDefault true;
zsh.enable = lib.mkDefault true; shell.neovim.enable = lib.mkDefault true;
neovim.enable = lib.mkDefault true; shell.btop.enable = lib.mkDefault true;
btop.enable = lib.mkDefault true; shell.bat.enable = lib.mkDefault true;
bat.enable = lib.mkDefault true;
direnv.enable = lib.mkDefault true;
};
}; };
} }

View File

@ -1,19 +0,0 @@
{
lib,
config,
...
}: let
cfg = config.myConfig.shell.direnv;
in {
options.myConfig.shell.direnv = {
enable = lib.mkEnableOption "direnv for changing the environment when entering a directory";
};
config = lib.mkIf cfg.enable {
programs.direnv = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
};
}

View File

@ -4,34 +4,16 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.myConfig.shell.neovim; cfg = config.shell.neovim;
in { in {
options.myConfig.shell.neovim = { options = {
enable = lib.mkEnableOption "neovim"; shell.neovim.enable = lib.mkEnableOption "neovim";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.neovim = { home.packages = with pkgs; [neovim];
enable = true; home.sessionVariables = {
defaultEditor = true; EDITOR = "${pkgs.neovim}/bin/nvim";
plugins = with pkgs.vimPlugins; [
lazy-nvim
];
extraLuaConfig = ''
require "lazy_setup"
'';
extraPackages = with pkgs; [
gnumake
clang
gcc
zig
cargo
rust-analyzer
rustup
nodejs
];
}; };
home.file.".config/nvim/lua".source = ./nvim-lua;
}; };
} }

View File

@ -1,24 +0,0 @@
return {
"AstroNvim/astrocommunity",
{ import = "astrocommunity.pack.bash" },
{ import = "astrocommunity.pack.cmake" },
{ import = "astrocommunity.pack.cpp" },
{ import = "astrocommunity.pack.docker" },
{ import = "astrocommunity.pack.html-css" },
{ import = "astrocommunity.pack.json" },
{ import = "astrocommunity.pack.lua" },
{ import = "astrocommunity.pack.markdown" },
{ import = "astrocommunity.pack.nix" },
{ import = "astrocommunity.pack.python" },
{ import = "astrocommunity.pack.rust" },
{ import = "astrocommunity.pack.toml" },
{ import = "astrocommunity.pack.yaml" },
{ import = "astrocommunity.git.git-blame-nvim" },
{ import = "astrocommunity.markdown-and-latex.vimtex" },
{ import = "astrocommunity.lsp.lsp-inlayhints-nvim" },
{ import = "astrocommunity.lsp.lsp-lens-nvim" },
{ import = "astrocommunity.lsp.lsp-signature-nvim" },
{ import = "astrocommunity.lsp.nvim-lsp-file-operations" },
{ import = "astrocommunity.bars-and-lines.vim-illuminate" },
}

View File

@ -1,33 +0,0 @@
require("lazy").setup({
{
"AstroNvim/AstroNvim",
version = "^4", -- Remove version tracking to elect for nighly AstroNvim
import = "astronvim.plugins",
opts = { -- AstroNvim options must be set here with the `import` key
mapleader = " ", -- This ensures the leader key must be configured before Lazy is set up
maplocalleader = ",", -- This ensures the localleader key must be configured before Lazy is set up
icons_enabled = true, -- Set to false to disable icons (if no Nerd Font is available)
pin_plugins = nil, -- Default will pin plugins when tracking `version` of AstroNvim, set to true/false to override
update_notifications = true, -- Enable/disable notification about running `:Lazy update` twice to update pinned plugins
},
},
{ import = "community" },
{ import = "plugins" },
} --[[@as LazySpec]], {
-- Configure any other `lazy.nvim` configuration options here
install = { colorscheme = { "astrodark", "habamax" } },
ui = { backdrop = 100 },
performance = {
rtp = {
-- disable some rtp plugins, add more to your liking
disabled_plugins = {
"gzip",
"netrwPlugin",
"tarPlugin",
"tohtml",
"zipPlugin",
},
},
},
} --[[@as LazyConfig]])

View File

@ -1,35 +0,0 @@
---@type LazySpec
return {
"AstroNvim/astrocore",
opts = {
options = {
opt = {
relativenumber = false,
number = true,
spell = true,
signcolumn = "yes",
wrap = true,
colorcolumn = "80,120",
},
g = {
inlay_hints_enabled = true,
},
},
lsp = {
config = {
rust_analyzer = {
settings = {
["rust-analyzer"] = {
cargo = { buildScripts = { enable = true } },
procMacro = { enable = true },
check = {
command = "clippy",
},
},
},
},
clangd = { capabilities = { offsetEncoding = "utf-8" } },
},
},
},
}

View File

@ -1,29 +0,0 @@
return {
{
"p00f/clangd_extensions.nvim",
optional = true,
opts = { extensions = { autoSetHints = true } },
init = function()
--load clangd extensions when clangd attaches
local augroup = vim.api.nvim_create_augroup("clangd_extensions", { clear = true })
vim.api.nvim_create_autocmd("LspAttach", {
group = augroup,
desc = "Load clangd_extensions with clangd",
callback = function(args)
if assert(vim.lsp.get_client_by_id(args.data.client_id)).name == "clangd" then
require("clangd_extensions")
require("clangd_extensions.inlay_hints").setup_autocmd()
require("clangd_extensions.inlay_hints").set_inlay_hints()
vim.api.nvim_del_augroup_by_id(augroup)
end
end,
})
end,
},
{
"simrat39/rust-tools.nvim",
optional = true,
opts = { tools = { inlay_hints = { auto = true } } },
},
}

View File

@ -4,16 +4,16 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.myConfig.shell.zsh; cfg = config.shell.zsh;
in { in {
options.myConfig.shell.zsh = { options = {
enable = lib.mkEnableOption "Zsh, an advanced shell"; shell.zsh.enable = lib.mkEnableOption "Zsh, an advanced shell";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.zsh = { programs.zsh = {
enable = true; enable = true;
autosuggestion.enable = true; enableAutosuggestions = true;
enableCompletion = true; enableCompletion = true;
defaultKeymap = "emacs"; defaultKeymap = "emacs";
dotDir = ".config/zsh"; dotDir = ".config/zsh";

View File

@ -4,7 +4,7 @@
lib, lib,
... ...
}: let }: let
cfg = config.myConfig.sway; cfg = config.sway;
rotate_lisgd = pkgs.writeShellScriptBin "rotate_lisgd" '' rotate_lisgd = pkgs.writeShellScriptBin "rotate_lisgd" ''
# PREV_ORIENTATION and ORIENTATION are given by rot8 # PREV_ORIENTATION and ORIENTATION are given by rot8
@ -44,22 +44,19 @@
in { in {
imports = [./kanshi.nix ./waybar.nix ./theme.nix ./mako.nix]; imports = [./kanshi.nix ./waybar.nix ./theme.nix ./mako.nix];
options.myConfig.sway = { options = {
enable = lib.mkEnableOption "sway, a lightweight window manager"; sway.enable = lib.mkEnableOption "sway, a lightweight window manager";
laptop = lib.mkEnableOption "laptop config"; sway.laptop = lib.mkEnableOption "laptop config";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
myConfig.sway = { sway.kanshi.enable = lib.mkDefault true;
kanshi.enable = lib.mkDefault true; sway.waybar.enable = lib.mkDefault true;
waybar.enable = lib.mkDefault true; sway.theming.enable = lib.mkDefault true;
theming.enable = lib.mkDefault true; sway.mako.enable = lib.mkDefault true;
mako.enable = lib.mkDefault true; sway.waybar.battery = lib.mkIf cfg.laptop (lib.mkDefault true);
waybar.battery = lib.mkIf cfg.laptop (lib.mkDefault true); sway.waybar.backlight = lib.mkIf cfg.laptop (lib.mkDefault true);
waybar.backlight = lib.mkIf cfg.laptop (lib.mkDefault true); sway.waybar.squeekboard = lib.mkIf cfg.laptop (lib.mkDefault true);
waybar.squeekboard = lib.mkIf cfg.laptop (lib.mkDefault true);
kanshi.laptop = lib.mkIf cfg.laptop (lib.mkDefault true);
};
home.packages = with pkgs; [ home.packages = with pkgs; [
swaylock # screen locking swaylock # screen locking

View File

@ -4,28 +4,25 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.myConfig.sway.kanshi; cfg = config.sway.kanshi;
in { in {
options.myConfig.sway.kanshi = { options = {
enable = lib.mkEnableOption "kanshi, a dynamic display recognizer"; sway.kanshi.enable = lib.mkEnableOption "kanshi, a dynamic display recognizer";
laptop = lib.mkEnableOption "laptop workspaces"; sway.kanshi.laptop = lib.mkEnableOption "laptop workspaces";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.kanshi = { services.kanshi = {
enable = true; enable = true;
settings = lib.mkIf cfg.laptop [ profiles = lib.mkIf cfg.laptop {
{ laptop.outputs = [
profile.name = "laptop";
profile.outputs = [
{ {
criteria = "eDP-1"; criteria = "eDP-1";
position = "0,0"; position = "0,0";
} }
]; ];
} dock_luhbots = {
{ outputs = [
profile.outputs = [
{ {
criteria = "eDP-1"; criteria = "eDP-1";
position = "0,1080"; position = "0,1080";
@ -40,16 +37,16 @@ in {
position = "1920,0"; position = "1920,0";
} }
]; ];
profile.exec = [ exec = [
"${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-4" "${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-4"
"${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-5" "${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-5"
"${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-4" "${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-4"
]; ];
} };
{ dock_luhbots2 = {
profile.outputs = [ outputs = [
{ {
criteria = "eDP-1"; criteria = "eDP-1";
position = "1080,1080"; position = "1080,1080";
@ -64,16 +61,16 @@ in {
position = "0,0"; position = "0,0";
} }
]; ];
profile.exec = [ exec = [
"${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-4" "${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-4"
"${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-5" "${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-5"
"${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-4" "${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-4"
]; ];
} };
{ dock_luhbots3 = {
profile.outputs = [ outputs = [
{ {
criteria = "eDP-1"; criteria = "eDP-1";
position = "0,1080"; position = "0,1080";
@ -88,16 +85,16 @@ in {
position = "1920,0"; position = "1920,0";
} }
]; ];
profile.exec = [ exec = [
"${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-6" "${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-6"
"${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-7" "${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-7"
"${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-6" "${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-6"
]; ];
} };
{ dock_luhbots4 = {
profile.outputs = [ outputs = [
{ {
criteria = "eDP-1"; criteria = "eDP-1";
position = "1080,1080"; position = "1080,1080";
@ -112,17 +109,16 @@ in {
position = "0,0"; position = "0,0";
} }
]; ];
profile.exec = [ exec = [
"${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-3" "${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-3"
"${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-4" "${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-4"
"${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-3" "${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-3"
]; ];
} };
{ laptop_hannspree = {
profile.name = "docked-4k"; outputs = [
profile.outputs = [
{ {
criteria = "eDP-1"; criteria = "eDP-1";
position = "320,1440"; position = "320,1440";
@ -134,15 +130,15 @@ in {
scale = 1.5; scale = 1.5;
} }
]; ];
profile.exec = [ exec = [
"${pkgs.sway}/bin/swaymsg workspace 1, move workspace to HDMI-A-1" "${pkgs.sway}/bin/swaymsg workspace 1, move workspace to HDMI-A-1"
"${pkgs.sway}/bin/swaymsg workspace 2, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 2, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 5, move workspace to HDMI-A-1" "${pkgs.sway}/bin/swaymsg workspace 5, move workspace to HDMI-A-1"
]; ];
} };
]; };
}; };
}; };
} }

View File

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myConfig.sway.mako; cfg = config.sway.mako;
in { in {
options.myConfig.sway.mako = { options = {
enable = lib.mkEnableOption "mako, a notification deamon"; sway.mako.enable = lib.mkEnableOption "mako, a notification deamon";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.myConfig.sway.theming; cfg = config.sway.theming;
# currently, there is some friction between sway and gtk: # currently, there is some friction between sway and gtk:
# https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland # https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
@ -13,8 +13,8 @@
gsettings set $gnome_schema gtk-theme 'Dracula' gsettings set $gnome_schema gtk-theme 'Dracula'
''; '';
in { in {
options.myConfig.sway.theming = { options = {
enable = lib.mkEnableOption "theming for sway"; sway.theming.enable = lib.mkEnableOption "theming for sway";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.myConfig.sway.waybar; cfg = config.sway.waybar;
schema = "org.gnome.desktop.a11y.applications"; schema = "org.gnome.desktop.a11y.applications";
key = "screen-keyboard-enabled"; key = "screen-keyboard-enabled";
@ -25,12 +25,12 @@
fi fi
''; '';
in { in {
options.myConfig.sway.waybar = { options = {
enable = lib.mkEnableOption "waybar, a status bar for wayland compositors"; sway.waybar.enable = lib.mkEnableOption "waybar, a status bar for wayland compositors";
squeekboard = lib.mkEnableOption "squeekboard"; sway.waybar.squeekboard = lib.mkEnableOption "squeekboard";
mpd = lib.mkEnableOption "mpd"; sway.waybar.mpd = lib.mkEnableOption "mpd";
battery = lib.mkEnableOption "battery"; sway.waybar.battery = lib.mkEnableOption "battery";
backlight = lib.mkEnableOption "backlight"; sway.waybar.backlight = lib.mkEnableOption "backlight";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -1,21 +0,0 @@
{
lib,
config,
...
}: let
cfg = config.myConfig.bootloader;
in {
options.myConfig.bootloader = {
enable = lib.mkEnableOption "enable systemd bootloader";
};
config = lib.mkIf cfg.enable {
boot.loader = {
timeout = 0;
systemd-boot.enable = true;
systemd-boot.memtest86.enable = true;
systemd-boot.editor = false;
efi.canTouchEfiVariables = true;
};
};
}

View File

@ -1,47 +0,0 @@
{
lib,
config,
pkgs,
...
}: let
cfg = config.myConfig.cups;
in {
options.myConfig.cups = {
enable = lib.mkEnableOption "printing";
};
config = {
# Enable CUPS to print documents.
services.printing = {
enable = true;
drivers = [pkgs.samsung-unified-linux-driver];
};
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
hardware.printers = {
ensurePrinters = [
{
name = "Samsung_ML-1630W_Series";
location = "luhbots";
deviceUri = "dnssd://Samsung%20ML-1630W%20Series%20(SEC00159937E684)._pdl-datastream._tcp.local/";
model = "samsung/ML-1630W.ppd";
ppdOptions = {
PageSize = "A4";
};
}
{
name = "Brother_HL-L3210CW_series";
location = "Max Zimmer";
deviceUri = "dnssd://Brother%20HL-L3210CW%20series._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-900f0c617136";
model = "drv:///sample.drv/generic.ppd";
ppdOptions = {
PageSize = "A4";
};
}
];
};
};
}

View File

@ -1,30 +0,0 @@
{
lib,
config,
...
}: let
cfg = config.myConfig;
in {
imports = [./bootloader.nix ./locale.nix ./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix ./cups.nix ./gpu/amd.nix];
options.myConfig = {
enable = lib.mkEnableOption "my custom config";
desktop = lib.mkEnableOption "custom config with desktop support";
laptop = lib.mkEnableOption "extra stuff for laptops like wifi";
};
config.myConfig = lib.mkIf cfg.enable {
bootloader.enable = true;
locale.enable = true;
rebuild.enable = true;
greetd.enable = lib.mkIf cfg.desktop true;
sway.enable = lib.mkIf cfg.desktop true;
music.enable = lib.mkIf cfg.desktop true;
cups.enable = lib.mkIf cfg.desktop true;
wifi.tray = lib.mkIf cfg.desktop true;
sway.laptop = lib.mkIf cfg.laptop true;
wifi.enable = lib.mkIf cfg.laptop true;
};
}

View File

@ -1,40 +0,0 @@
{
lib,
config,
pkgs,
...
}: let
cfg = config.myConfig.gpu.amd;
in {
options.myConfig.gpu.amd = {
enable = lib.mkEnableOption "enable amd gpu hardware acceleration";
};
config = lib.mkIf cfg.enable {
boot.initrd.kernelModules = ["amdgpu"];
services.xserver.videoDrivers = ["amdgpu"];
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
];
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
rocmPackages.clr.icd
amdvlk
];
extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
];
driSupport = true;
driSupport32Bit = true;
};
environment.systemPackages = with pkgs; [
glxinfo
vulkan-tools
gpu-viewer
];
};
}

View File

@ -1,30 +1,24 @@
{ {
lib,
config, config,
lib,
pkgs, pkgs,
... ...
}: let }: let
cfg = config.myConfig.greetd;
themeEnv = '' themeEnv = ''
export XDG_DATA_DIRS="${pkgs.whitesur-gtk-theme}/share:$XDG_DATA_DIRS" export XDG_DATA_DIRS="${pkgs.whitesur-gtk-theme}/share:$XDG_DATA_DIRS"
export XDG_DATA_DIRS="${pkgs.whitesur-icon-theme}/share:$XDG_DATA_DIRS" export XDG_DATA_DIRS="${pkgs.whitesur-icon-theme}/share:$XDG_DATA_DIRS"
export XDG_DATA_DIRS="${pkgs.whitesur-cursors}/share:$XDG_DATA_DIRS" export XDG_DATA_DIRS="${pkgs.whitesur-cursors}/share:$XDG_DATA_DIRS"
''; '';
in { in {
options.myConfig.greetd = {
enable = lib.mkEnableOption "greetd, a light weight greater deamon";
};
config = lib.mkIf cfg.enable {
environment.extraInit = themeEnv; environment.extraInit = themeEnv;
programs.regreet = { programs.regreet = {
enable = true; enable = true;
settings = { settings = {
background = { background = {
fit = "Contain"; fit = "Contain";
path = ../../assets/bg4k.png; path = "/home/max/Documents/Blender/desktop background Informatiker/render 4K new color.png";
}; };
GTK = { gtk = {
application_prefer_dark_theme = true; application_prefer_dark_theme = true;
cursor_theme_name = "capitaine-cursors-white"; cursor_theme_name = "capitaine-cursors-white";
font_name = "FiraCode Nerd Font 20"; font_name = "FiraCode Nerd Font 20";
@ -55,5 +49,4 @@ in {
whitesur-icon-theme whitesur-icon-theme
whitesur-cursors whitesur-cursors
]; ];
};
} }

View File

@ -1,34 +0,0 @@
{
lib,
config,
...
}: let
cfg = config.myConfig.locale;
in {
options.myConfig.locale = {
enable = lib.mkEnableOption "custom locale";
};
config = lib.mkIf cfg.enable {
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
# Configure console keymap
console.keyMap = "de";
};
}

View File

@ -1,33 +0,0 @@
{
lib,
config,
pkgs,
...
}: let
cfg = config.myConfig.music;
in {
options.myConfig.music = {
enable = lib.mkEnableOption "sound system";
};
config = lib.mkIf cfg.enable {
musnix = {
enable = true;
rtcqs.enable = true;
kernel.realtime = true;
kernel.packages = pkgs.linuxPackages-rt_latest;
};
users.users.max.extraGroups = ["audio"];
sound.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
};
security.rtkit.enable = true;
};
}

View File

@ -1,11 +1,4 @@
{ {pkgs, ...}: let
lib,
config,
pkgs,
...
}: let
cfg = config.myConfig.rebuild;
# script for rebuilding nixos # script for rebuilding nixos
rebuild = pkgs.writeShellScriptBin "rebuild" '' rebuild = pkgs.writeShellScriptBin "rebuild" ''
# A rebuild script that commits on a successful build # A rebuild script that commits on a successful build
@ -44,11 +37,5 @@
${pkgs.libnotify}/bin/notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available ${pkgs.libnotify}/bin/notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available
''; '';
in { in {
options.myConfig.rebuild = {
enable = lib.mkEnableOption "rebuild script with automatic git commits";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [rebuild]; environment.systemPackages = [rebuild];
};
} }

View File

@ -1,15 +1,4 @@
{ {sops, ...}: {
lib,
config,
...
}: let
cfg = config.myConfig.sops;
in {
options.myConfig.sops = {
enable = lib.mkEnableOption "sops, an secrets manager";
};
config = lib.mkIf cfg.enable {
sops = { sops = {
age.keyFile = /home/max/.config/sops/age/keys.txt; age.keyFile = /home/max/.config/sops/age/keys.txt;
secrets = { secrets = {
@ -42,5 +31,4 @@ in {
}; };
}; };
}; };
};
} }

View File

@ -1,22 +1,37 @@
{ {
lib,
config, config,
pkgs, pkgs,
lib,
... ...
}: let }: {
cfg = config.myConfig.sway;
in {
options.myConfig.sway = {
enable = lib.mkEnableOption "sway";
laptop = lib.mkEnableOption "enable laptop things (backlight)";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
dbus # make dbus-update-activation-environment available in the path dbus # make dbus-update-activation-environment available in the path
wayland
xdg-utils # for opening default programs when clicking links
glib # gsettings
dracula-theme # gtk theme
gnome3.adwaita-icon-theme # default gnome cursors
swaylock
swayidle
grim # screenshot functionality
slurp # screenshot functionality
wl-clipboard # wl-copy and wl-paste for copy/paste from stdin/stdout
mako # notification system developed by swaywm maintainer
wdisplays # tool to configure displays
libnotify libnotify
]; ];
sound.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
};
security.rtkit.enable = true;
# xdg-desktop-portal works by exposing a series of D-Bus interfaces # xdg-desktop-portal works by exposing a series of D-Bus interfaces
# known as portals under a well-known name # known as portals under a well-known name
# (org.freedesktop.portal.Desktop) and object path # (org.freedesktop.portal.Desktop) and object path
@ -38,10 +53,11 @@ in {
}; };
# make brightness keys work # make brightness keys work
users.users.max.extraGroups = ["video" "input"]; users.users.max.extraGroups = ["video"];
programs.light.enable = lib.mkIf cfg.laptop true; programs.light.enable = true;
# make swaylock work # make swaylock work
security.pam.services.swaylock = {}; security.pam.services.swaylock = {};
};
users.extraUsers.max.extraGroups = ["input"];
} }

View File

@ -1,63 +1,9 @@
{ {
lib,
config, config,
pkgs, pkgs,
... ...
}: let }: {
cfg = config.myConfig.wifi; sops.templates = let
in {
options.myConfig.wifi = {
enable = lib.mkEnableOption "wifi";
tray = lib.mkEnableOption "nm tray entry";
};
config = lib.mkIf cfg.enable {
environment.etc = let
template = config.sops.templates;
base = "NetworkManager/system-connections";
in {
"${base}/home.nmconnection".source = template."home.nmconnection".path;
"${base}/parents.nmconnection".source = template."parents.nmconnection".path;
"${base}/eduroam.nmconnection".source = template."eduroam.nmconnection".path;
"${base}/luhbots.nmconnection".source = template."luhbots.nmconnection".path;
"${base}/luhbots5.nmconnection".source = template."luhbots5.nmconnection".path;
};
networking.networkmanager.enable = true;
environment.systemPackages = lib.optional cfg.tray pkgs.nm-tray;
myConfig.sops.enable = true;
sops = {
secrets = {
"home/ssid" = {
sopsFile = ../../secrets/wifi.yaml;
};
"home/psk" = {
sopsFile = ../../secrets/wifi.yaml;
};
"parents/ssid" = {
sopsFile = ../../secrets/wifi.yaml;
};
"parents/psk" = {
sopsFile = ../../secrets/wifi.yaml;
};
"eduroam/ident" = {
sopsFile = ../../secrets/wifi.yaml;
};
"eduroam/psk" = {
sopsFile = ../../secrets/wifi.yaml;
};
"luhbots/ssid" = {
sopsFile = ../../secrets/wifi.yaml;
};
"luhbots/ssid5" = {
sopsFile = ../../secrets/wifi.yaml;
};
"luhbots/psk" = {
sopsFile = ../../secrets/wifi.yaml;
};
};
templates = let
placeholder = config.sops.placeholder; placeholder = config.sops.placeholder;
in { in {
"home.nmconnection".content = '' "home.nmconnection".content = ''
@ -142,6 +88,19 @@ in {
psk=${placeholder."luhbots/psk"} psk=${placeholder."luhbots/psk"}
''; '';
}; };
environment.etc = let
template = config.sops.templates;
base = "NetworkManager/system-connections";
in {
"${base}/home.nmconnection".source = template."home.nmconnection".path;
"${base}/parents.nmconnection".source = template."parents.nmconnection".path;
"${base}/eduroam.nmconnection".source = template."eduroam.nmconnection".path;
"${base}/luhbots.nmconnection".source = template."luhbots.nmconnection".path;
"${base}/luhbots5.nmconnection".source = template."luhbots5.nmconnection".path;
}; };
}; networking.networkmanager.enable = true;
environment.systemPackages = with pkgs; [
nm-tray
];
} }