From f502917b6a11d709ec49a68abd49c35238f3d4e0 Mon Sep 17 00:00:00 2001 From: Janne Peltola Date: Tue, 10 Feb 2026 21:38:16 +0200 Subject: [PATCH] First working version --- flake.lock | 178 ++++++++++++++++++++++++++++++++-------- flake.nix | 54 ++++++------ home-manager/emacs.el | 8 ++ home-manager/home.nix | 40 ++++----- nixos/configuration.nix | 58 ++++++++++++- 5 files changed, 249 insertions(+), 89 deletions(-) diff --git a/flake.lock b/flake.lock index 024f487..b90b9ad 100644 --- a/flake.lock +++ b/flake.lock @@ -1,22 +1,43 @@ { "nodes": { - "dms": { + "dgop": { "inputs": { "nixpkgs": [ - "nixpkgs-unstable" - ], - "quickshell": "quickshell" + "nixpkgs" + ] }, "locked": { - "lastModified": 1770134613, - "narHash": "sha256-YjwlcLT/Of9MLIlQeWZ5XBHW4GbKRV1nUB5zGcYZznE=", + "lastModified": 1769696720, + "narHash": "sha256-CxTvTx7WYKj9usa1uZDUmCqS9+W0QoIeTGDlkhHLVho=", "owner": "AvengeMedia", - "repo": "DankMaterialShell", - "rev": "3c4749ead0ef30237330cc56437990164b575c76", + "repo": "dgop", + "rev": "3f96465aacac7f4f304bacf154f57fc0077ad26d", "type": "github" }, "original": { "owner": "AvengeMedia", + "repo": "dgop", + "type": "github" + } + }, + "dms": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "quickshell": "quickshell" + }, + "locked": { + "lastModified": 1768575133, + "narHash": "sha256-P//moH3z9r4PXirTzXVsccQINsK5AIlF9RWOBwK3vLc=", + "owner": "AvengeMedia", + "repo": "DankMaterialShell", + "rev": "a7cdb39b0b89b9af86160ad4e847a7d14ea44512", + "type": "github" + }, + "original": { + "owner": "AvengeMedia", + "ref": "stable", "repo": "DankMaterialShell", "type": "github" } @@ -28,43 +49,84 @@ ] }, "locked": { - "lastModified": 1763992789, - "narHash": "sha256-WHkdBlw6oyxXIra/vQPYLtqY+3G8dUVZM8bEXk0t8x4=", + "lastModified": 1770318660, + "narHash": "sha256-yFVde8QZK7Dc0Xa8eQDsmxLX4NJNfL1NKfctSyiQgMY=", "owner": "nix-community", "repo": "home-manager", - "rev": "44831a7eaba4360fb81f2acc5ea6de5fde90aaa3", + "rev": "471e6a065f9efed51488d7c51a9abbd387df91b8", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-25.05", "repo": "home-manager", "type": "github" } }, + "niri": { + "inputs": { + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1770571272, + "narHash": "sha256-IUBQMceKisLf1aqo0OWIuEEJLYCQjpvfAJYNZCqu5wE=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "992922f59953b7f55f6b2de7f8bb661e93bc210e", + "type": "github" + }, + "original": { + "owner": "sodiboo", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1756556321, + "narHash": "sha256-RLD89dfjN0RVO86C/Mot0T7aduCygPGaYbog566F0Qo=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "01be0e65f4eb91a9cd624ac0b76aaeab765c7294", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v25.08", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1770394936, + "narHash": "sha256-Pa0fkyLYUR+pZh7phPENDUo4mJIweaAm0uV83iUUlX8=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "549148d27779d024255a84535b42b947f1c2a113", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1767313136, - "narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=", + "lastModified": 1770197578, + "narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-25.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1770115704, - "narHash": "sha256-KHFT9UWOF2yRPlAnSXQJh6uVcgNcWlFqqiAZ7OVlHNc=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "e6eae2ee2110f3d31110d5c222cd395303343b08", + "rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", "type": "github" }, "original": { @@ -74,6 +136,22 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1770464364, + "narHash": "sha256-z5NJPSBwsLf/OfD8WTmh79tlSU8XgIbwmk6qB1/TFzY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "23d72dabcb3b12469f57b37170fcbc1789bd7457", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, "quickshell": { "inputs": { "nixpkgs": [ @@ -98,10 +176,44 @@ }, "root": { "inputs": { + "dgop": "dgop", "dms": "dms", "home-manager": "home-manager", - "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable" + "niri": "niri", + "nixpkgs": "nixpkgs" + } + }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1755491097, + "narHash": "sha256-m+9tUfsmBeF2Gn4HWa6vSITZ4Gz1eA1F5Kh62B0N4oE=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "388d291e82ffbc73be18169d39470f340707edaa", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.7", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1770568598, + "narHash": "sha256-w7XGGbI3cxtJWK/B2n+yuhm1S3Vv21OPtIMFLTwbU20=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "e6dd3c05c098aef4e6a31fa95c04f129e9b52618", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 50d48bf..dd24966 100644 --- a/flake.nix +++ b/flake.nix @@ -3,26 +3,31 @@ inputs = { # Nixpkgs - nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; - nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # Home manager - home-manager.url = "github:nix-community/home-manager/release-25.05"; + home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; # Dank Linux dms = { - url = "github:AvengeMedia/DankMaterialShell"; - inputs.nixpkgs.follows = "nixpkgs-unstable"; + url = "github:AvengeMedia/DankMaterialShell/stable"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + dgop = { + url = "github:AvengeMedia/dgop"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + niri = { + url = "github:sodiboo/niri-flake"; + inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, - nixpkgs, - home-manager, - dms, - nixpkgs-unstable, + nixpkgs, + home-manager, ... } @ inputs: let in { @@ -31,26 +36,17 @@ nixosConfigurations = { hermes = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs;}; - # > Our main nixos configuration file < - modules = [./nixos/configuration.nix]; - }; - }; - - # Standalone home-manager configuration entrypoint - # Available through 'home-manager --flake .#your-username@your-hostname' - homeConfigurations = { - "janne@hermes" = home-manager.lib.homeManagerConfiguration { - # Home-manager requires 'pkgs' instance - pkgs = nixpkgs.legacyPackages.x86_64-linux; - extraSpecialArgs = { - inherit inputs; - pkgs-unstable = import nixpkgs-unstable { - system = "x86_64-linux"; - config.allowUnfree = true; - }; - }; - # > Our main home-manager configuration file < - modules = [./home-manager/home.nix]; + # > Our main nixos configuration file + modules = [ + ./nixos/configuration.nix + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.users.janne = ./home-manager/home.nix; + home-manager.extraSpecialArgs = { + inherit inputs; + }; + } + ]; }; }; }; diff --git a/home-manager/emacs.el b/home-manager/emacs.el index 9b2fa01..0fde2fe 100644 --- a/home-manager/emacs.el +++ b/home-manager/emacs.el @@ -4,6 +4,8 @@ (menu-bar-mode -1) (tool-bar-mode -1) +(add-to-list 'default-frame-alist + '(vertical-scroll-bars . nil)) ;; Window navigation (windmove-default-keybindings) @@ -53,5 +55,11 @@ :config (use-package embark-consult)) +;; eglot +(require 'eglot) +(add-hook 'c-mode-hook 'eglot-ensure) +(add-hook 'c++-mode-hook 'eglot-ensure) +(add-hook 'c-or-c++-mode-hook 'eglot-ensure) + ;; ORG-MODE (setq org-replace-disputed-keys t) diff --git a/home-manager/home.nix b/home-manager/home.nix index acf20f7..dd9554d 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -1,25 +1,13 @@ { - inputs, - lib, config, pkgs, - pkgs-unstable, + inputs, ... }: { imports = [ - ./wayland.nix inputs.dms.homeModules.dank-material-shell ]; - nixpkgs = { - overlays = [ - ]; - config = { - allowUnfree = true; - allowUnfreePredicate = _: true; - }; - }; - home = { username = "janne"; homeDirectory = "/home/janne"; @@ -31,12 +19,21 @@ pkgs.pdfpc pkgs.ktailctl pkgs.kitty - pkgs.hyprpaper + pkgs.alacritty + pkgs.clang-tools + (pkgs.bottles.override { removeWarningPopup = true; }) + pkgs.dropbox + pkgs.unzip + ]; - programs.emacs = { + programs.dank-material-shell = { enable = true; - package = pkgs.emacs-gtk; + }; + + programs.emacs = { + enable = true; + package = pkgs.emacs-pgtk; extraPackages = epkgs: [ epkgs.nix-mode epkgs.magit @@ -55,20 +52,15 @@ programs.zsh.enable = true; - programs.dankMaterialShell = { - enable = true; - quickshell.package = pkgs-unstable.quickshell; - }; - # Enable home-manager and git - programs.home-manager.enable = true; programs.git = { enable = true; - userName = "Janne Peltola"; - userEmail = "git@jannepeltola.net"; + settings.user.name = "Janne Peltola"; + settings.user.email = "git@jannepeltola.net"; }; + services.kdeconnect.enable = true; # Nicely reload system units when changing configs systemd.user.startServices = "sd-switch"; diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 8109556..91975c6 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -9,6 +9,7 @@ }: { imports = [ ./hardware-configuration.nix + inputs.dms.nixosModules.dank-material-shell ]; nixpkgs = { @@ -95,10 +96,49 @@ #jack.enable = true; }; + # Additional packages + environment.systemPackages = [ + pkgs.xwayland-satellite + ]; - # Enable the KDE Plasma Desktop Environment. - services.displayManager.sddm.enable = true; - services.desktopManager.plasma6.enable = true; + + # Use DMS and niri + programs.dank-material-shell = { + enable = true; + systemd = { + enable = true; + restartIfChanged = true; + }; + enableSystemMonitoring = true; + enableVPN = true; + enableDynamicTheming = true; + enableAudioWavelength = true; + enableCalendarEvents = true; + }; + + programs.niri = { + enable = true; + }; + services.displayManager.dms-greeter = { + enable = true; + compositor.name = "niri"; # Or "hyprland" or "sway" + configHome = "/home/janne"; + }; + programs.dsearch = { + enable = true; + systemd = { + enable = true; # Enable systemd user service + target = "default.target"; # Start with user session + }; + }; + + #services.displayManager.sddm = { + # enable = true; + # wayland = { + # enable = true; + # }; + #}; + # services.desktopManager.plasma6.enable = true; # Activate global programs programs.firefox.enable = true; @@ -109,6 +149,8 @@ noto-fonts-color-emoji fira-code fira-code-symbols + vista-fonts + corefonts ] ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts); # Set up 1password @@ -130,6 +172,10 @@ }; }; + # ssh-agent; do not use the Gnome agent + services.gnome.gcr-ssh-agent.enable = false; + programs.ssh.startAgent = true; + # This setups a SSH server. Very important if you're setting up a headless system. # Feel free to remove if you don't need it. services.openssh = { @@ -140,6 +186,12 @@ }; }; + networking.firewall = rec { + allowedTCPPortRanges = [{ from = 1714; to = 1764; } ]; + allowedUDPPortRanges = allowedTCPPortRanges; + }; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion system.stateVersion = "25.05"; }