diff --git a/flake.lock b/flake.lock index 6c03153..4b39a4f 100644 --- a/flake.lock +++ b/flake.lock @@ -145,6 +145,27 @@ "type": "github" } }, + "flake-utils": { + "inputs": { + "systems": [ + "swayfx", + "systems" + ] + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -807,10 +828,60 @@ "nixos-cli": "nixos-cli", "nixpkgs": "nixpkgs_5", "noctalia": "noctalia", + "swayfx": "swayfx", "walker": "walker", "zen-browser": "zen-browser" } }, + "scenefx": { + "inputs": { + "flake-utils": [ + "swayfx", + "flake-utils" + ], + "nixpkgs": [ + "swayfx", + "nixpkgs" + ], + "systems": "systems_4" + }, + "locked": { + "lastModified": 1768403764, + "narHash": "sha256-1RVLChp1WUcjnDu30jG2DTXW0A6K3lkezEip3KTf/gE=", + "owner": "wlrfx", + "repo": "scenefx", + "rev": "05a5e7a9177de04bc398e25821c0898c2a284c9f", + "type": "github" + }, + "original": { + "owner": "wlrfx", + "repo": "scenefx", + "type": "github" + } + }, + "swayfx": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ], + "scenefx": "scenefx", + "systems": "systems_5" + }, + "locked": { + "lastModified": 1769467630, + "narHash": "sha256-SufN5nd0+BojwTpe2tPuFIXswpLGo4syG/OwBF2Glzs=", + "owner": "WillPower3309", + "repo": "swayfx", + "rev": "c4ce2331c90120fafc12ba86200591255e836caf", + "type": "github" + }, + "original": { + "owner": "WillPower3309", + "repo": "swayfx", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, @@ -910,7 +981,7 @@ "elephant" ], "nixpkgs": "nixpkgs_7", - "systems": "systems_5" + "systems": "systems_4" }, "locked": { "lastModified": 1773675699, diff --git a/flake.nix b/flake.nix index 3d2d0ae..1121187 100644 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,10 @@ url = "github:hyprwm/hyprland-plugins"; inputs.hyprland.follows = "hyprland"; }; + swayfx = { + url = "github:WillPower3309/swayfx"; + inputs.nixpkgs.follows = "nixpkgs"; + }; agenix = { url = "github:ryantm/agenix"; }; @@ -41,6 +45,7 @@ nixos-cli, zen-browser, agenix, + swayfx, ... }: let @@ -59,6 +64,17 @@ agenix.nixosModules.default ]; }; + marty-thinkpad = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./hosts/marty-thinkpad + ./configuration.nix + home-manager.nixosModules.home-manager + nixos-cli.nixosModules.nixos-cli + agenix.nixosModules.default + ]; + }; marty-pc = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs; }; diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 0000000..0f4a582 --- /dev/null +++ b/home/default.nix @@ -0,0 +1,12 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + imports = [ + ./sway.nix + ]; +} diff --git a/home/niri.nix b/home/niri.nix new file mode 100644 index 0000000..2a93853 --- /dev/null +++ b/home/niri.nix @@ -0,0 +1,22 @@ +{ + config, + pkgs, + lib, + inputs, + ... +}: + +{ + options = { + desktop = { + sway = { + enable = lib.mkEnableOption "enable sway"; + }; + }; + + }; + config = { + wayland.windowManager.niri = { + }; + }; +}; \ No newline at end of file diff --git a/home/sway.nix b/home/sway.nix new file mode 100644 index 0000000..cf6c568 --- /dev/null +++ b/home/sway.nix @@ -0,0 +1,75 @@ +{ + config, + pkgs, + lib, + inputs, + ... +}: + +{ + options = { + desktop = { + sway = { + enable = lib.mkEnableOption "enable sway"; + }; + }; + + }; + config = { + wayland.windowManager.sway = { + enable = true; + package = pkgs.swayfx; + config = { + modifier = "Mod4"; + startup = [ + { command = "elephant"; } + ]; + keybindings = + let + modifier = config.wayland.windowManager.sway.config.modifier; + in + { + "${modifier}+Return" = "exec ${config.wayland.windowManager.sway.config.terminal}"; + "${modifier}+Shift+q" = "kill"; + "${modifier}+d" = "exec walker"; + "${modifier}+o" = "exec zen"; + "${modifier}+Control+right" = "exec /home/marty/.config/sway/scripts/workspaceswitcher right"; + "${modifier}+Control+left" = "exec /home/marty/.config/sway/scripts/workspaceswitcher left"; + "${modifier}+f" = "fullscreen"; + + + "${modifier}+1" = "workspace number 1"; + "${modifier}+2" = "workspace number 2"; + "${modifier}+3" = "workspace number 3"; + "${modifier}+4" = "workspace number 4"; + "${modifier}+5" = "workspace number 5"; + "${modifier}+6" = "workspace number 6"; + "${modifier}+7" = "workspace number 7"; + "${modifier}+8" = "workspace number 8"; + "${modifier}+9" = "workspace number 9"; + "${modifier}+s" = "workspace number 0"; + + + "${modifier}+Shift+1" = "move container to workspace number 1"; + "${modifier}+Shift+2" = "move container to workspace number 2"; + "${modifier}+Shift+3" = "move container to workspace number 3"; + "${modifier}+Shift+4" = "move container to workspace number 4"; + "${modifier}+Shift+5" = "move container to workspace number 5"; + "${modifier}+Shift+6" = "move container to workspace number 6"; + "${modifier}+Shift+7" = "move container to workspace number 7"; + "${modifier}+Shift+8" = "move container to workspace number 8"; + "${modifier}+Shift+9" = "move container to workspace number 9"; + "${modifier}+Shift+s" = "move container to workspace number 0"; + }; + input = { + "*" = { + xkb_layout = "de"; + }; + }; + defaultWorkspace = "workspace number 1"; + terminal = "${pkgs.kitty}/bin/kitty"; + }; + checkConfig = false; + }; + }; +} diff --git a/hosts/marty-thinkpad/default.nix b/hosts/marty-thinkpad/default.nix new file mode 100644 index 0000000..f555d3f --- /dev/null +++ b/hosts/marty-thinkpad/default.nix @@ -0,0 +1,45 @@ +{ + config, + lib, + pkgs, + home-manager, + inputs, + ... +}: + +{ + networking = { + hostName = "marty-thinkpad"; + }; + + home-manager = { + extraSpecialArgs = { inherit inputs; }; + useGlobalPkgs = true; + useUserPackages = true; + users = { + marty = import ./home.nix; + }; + }; + + main-user = { + userName = "marty"; + shell = pkgs.fish; + }; + + imports = [ + ./hardware.nix + ../../modules/desktop/niri.nix + # ../../modules/server/nginx.nix + ]; + + desktop.niri.enable = true; + + programs = { + light.enable = true; + }; + services.flatpak.enable = true; + services.xserver.videoDrivers = [ "nvidia" ]; + hardware.nvidia.modesetting.enable = true; + hardware.nvidia.open = true; + system.stateVersion = "24.11"; # Did you read the comment? +} diff --git a/hosts/marty-thinkpad/hardware.nix b/hosts/marty-thinkpad/hardware.nix new file mode 100644 index 0000000..fb851bb --- /dev/null +++ b/hosts/marty-thinkpad/hardware.nix @@ -0,0 +1,42 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/4920cf79-5972-4eaa-ba1a-56cac062320f"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/B7C8-039D"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/a9df5515-da5f-41fa-a371-31eec40dac73"; } + ]; + + # 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wwp0s29u1u6i6.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/marty-thinkpad/home.nix b/hosts/marty-thinkpad/home.nix new file mode 100644 index 0000000..34f7e05 --- /dev/null +++ b/hosts/marty-thinkpad/home.nix @@ -0,0 +1,97 @@ +{ + config, + pkgs, + inputs, + lib, + ... +}: + +{ + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "marty"; + home.homeDirectory = "/home/marty"; + + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "24.11"; # Please read the comment before changing. + + # The home.packages option allows you to install Nix packages into your + # environment. + + programs.fish.enable = true; + + home.packages = with pkgs; [ + # # Adds the 'hello' command to your environment. It prints a friendly + # # "Hello, world!" when run. + # hello + + # # It is sometimes useful to fine-tune packages, for example, by applying + # # overrides. You can do that directly here, just don't forget the + # # parentheses. Maybe you want to install Nerd Fonts with a limited number of + # # fonts? + # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) + + # # You can also create simple shell scripts directly inside your + # # configuration. For example, this adds a command 'my-hello' to your + # # environment: + # (pkgs.writeShellScriptBin "my-hello" '' + # echo "Hello, ${config.home.username}!" + # '') + ]; + + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; + + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; + + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. These will be explicitly sourced when using a + # shell provided by Home Manager. If you don't want to manage your shell + # through Home Manager then you have to manually source 'hm-session-vars.sh' + # located at either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/marty/etc/profile.d/hm-session-vars.sh + # + + device.type.laptop = true; + + desktop.hyprland = { + monitors = [ + "desc:AU Optronics 0x313E,1600x900@60,0x0,1" + ]; + }; + + imports = [ + inputs.walker.homeManagerModules.default + inputs.noctalia.homeModules.default + ./../../modules + ./../../home + + ]; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} diff --git a/modules/README.md b/modules/README.md new file mode 100644 index 0000000..6320a57 --- /dev/null +++ b/modules/README.md @@ -0,0 +1,7 @@ +# MODULES + +todo: +- [ ] move home-manager stuff to ../home +- [ ] add server stuff + +-> seperate home manager stuff from normal nix stuff, use home manager purely for dotfiles, use modules to install stuff \ No newline at end of file diff --git a/modules/desktop/README.md b/modules/desktop/README.md new file mode 100644 index 0000000..ef11780 --- /dev/null +++ b/modules/desktop/README.md @@ -0,0 +1,3 @@ +# HOME + +only for dotfiles, no longer installing stuff from here \ No newline at end of file diff --git a/modules/desktop/niri.nix b/modules/desktop/niri.nix new file mode 100644 index 0000000..80c92e4 --- /dev/null +++ b/modules/desktop/niri.nix @@ -0,0 +1,29 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + options = { + desktop = { + niri = { + enable = lib.mkEnableOption "enable niri"; + }; + }; + }; + config = lib.mkIf config.desktop.niri.enable { + + # Enable the gnome-keyring secrets vault. + # Will be exposed through DBus to programs willing to store secrets. + services.gnome.gnome-keyring.enable = true; + environment.systemPackages = with pkgs; [ +xwayland-satellite +niri +]; + programs.niri = { + enable = true; + }; + }; +} diff --git a/modules/desktop/sway.nix b/modules/desktop/sway.nix new file mode 100644 index 0000000..5b5384f --- /dev/null +++ b/modules/desktop/sway.nix @@ -0,0 +1,33 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + options = { + desktop = { + sway = { + enable = lib.mkEnableOption "enable sway"; + }; + }; + }; + config = lib.mkIf config.desktop.sway.enable { + environment.systemPackages = with pkgs; [ + grim # screenshot functionality + slurp # screenshot functionality + wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout + ]; + + # Enable the gnome-keyring secrets vault. + # Will be exposed through DBus to programs willing to store secrets. + services.gnome.gnome-keyring.enable = true; + + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + package = null; + }; + }; +} diff --git a/modules/terminal/kitty.nix b/modules/terminal/kitty.nix index 49a2716..0df21bf 100644 --- a/modules/terminal/kitty.nix +++ b/modules/terminal/kitty.nix @@ -62,7 +62,6 @@ inactive_text_alpha = 0.5; hide_window_decorations = "no"; - themeFile = "Catppuccin-Mocha"; # tab bar