diff --git a/configuration.nix b/configuration.nix index 789703e..162789c 100644 --- a/configuration.nix +++ b/configuration.nix @@ -15,6 +15,7 @@ "flakes" "nix-command" ]; + nixpkgs.config.allowUnfree = true; imports = [ ./system ./user diff --git a/flake.nix b/flake.nix index b189c6f..bb88c20 100644 --- a/flake.nix +++ b/flake.nix @@ -29,6 +29,16 @@ in { nixosConfigurations = { + marty-latitude = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./hosts/marty-latitude + ./configuration.nix + home-manager.nixosModules.home-manager + nixos-cli.nixosModules.nixos-cli + ]; + }; marty-pc = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs; }; @@ -50,16 +60,6 @@ ]; }; - marty-latitude = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; - modules = [ - ./hosts/marty-latitude - ./configuration.nix - home-manager.nixosModules.home-manager - nixos-cli.nixosModules.nixos-cli - ]; - }; }; }; } diff --git a/hosts/marty-latitude/default.nix b/hosts/marty-latitude/default.nix index 8e4975c..bac0778 100644 --- a/hosts/marty-latitude/default.nix +++ b/hosts/marty-latitude/default.nix @@ -27,4 +27,8 @@ }; imports = [ ./hardware.nix ]; + + programs = { + light.enable = true; + }; } diff --git a/hosts/marty-latitude/home.nix b/hosts/marty-latitude/home.nix index 5f59f01..a5e8ac1 100644 --- a/hosts/marty-latitude/home.nix +++ b/hosts/marty-latitude/home.nix @@ -81,55 +81,15 @@ GTK_THEME = "Adwaita:dark"; TERM = "xterm-kitty"; }; + + device.type.laptop = true; + + desktop.hyprland = { + monitors = [ + "desc:InfoVision Optoelectronics (Kunshan) Co.Ltd China 0x057E, 1366x768@60,0x0,1" + ]; + }; - development = { - vscodium.enable = true; - git.enable = true; - }; - terminal = { - kitty.enable = true; - ranger.enable = true; - }; - desktop = { - hyprland = { - enable = true; - monitors = [ - "desc:InfoVision Optoelectronics (Kunshan) Co.Ltd China 0x057E, 1366x768@60,0x0,1" - ]; - numlock = false; - }; - waybar.enable = true; - walker.enable = true; - wallpaper.enable = true; - grimblast.enable = true; - }; - misc = { - bitwarden.enable = true; - }; - syncthing = { - devices = { - marty-pc = { - id = "6PJZD52-EEWIO7U-MZMJJ5B-33DGNSU-O7DJVRT-GAE7QZG-ZY3VIMV-VSMBDQP"; - autoAcceptFolder = true; - }; - marty-server = { - id = "UDMXEKZ-HYIFI5S-VAKE75O-K3C65QV-LS43QA5-3JTHWKL-CI5C3Y6-P4NSQQM"; - autoAcceptFolders = true; - }; - marty-latitude = { - id = "SOAWHKA-BCQGO5G-IJ24WTO-RDETP5M-LNTVO66-MHIOUU2-NNQ57P6-FFKNSA6"; - autoAcceptFolders = true; - }; - marty-pixel = { - id = "GSBXOGW-6SYLDUQ-HPH7FBJ-CKHWQIK-K5YORB4-CYKGYT6-DLCVSAK-LA2RMAK"; - autoAcceptFolders = true; - }; - marty-fairphone = { - id = "2ISVWQV-4USY5IA-2OU55CE-Q7VLPD7-4RVQ5WX-FXQSJMY-2ES4EZG-IGFB7QG"; - autoAcceptFolders = true; - }; - }; - }; imports = [ inputs.walker.homeManagerModules.default diff --git a/hosts/marty-pc/home.nix b/hosts/marty-pc/home.nix index 78f557b..676c720 100644 --- a/hosts/marty-pc/home.nix +++ b/hosts/marty-pc/home.nix @@ -79,31 +79,34 @@ home.sessionVariables = { EDITOR = "codium"; }; - - development = { - vscodium.enable = true; - git.enable = true; - }; - terminal = { - kitty.enable = true; - }; - desktop = { - hyprland = { - enable = false; - numlock = true; - monitors = [ - "monitor = desc:AOC Q27G2WG4 0x00005F45, 2560x1440@144, 3840x0, 1 # main monitor" - "monitor = desc:Samsung Electric Company S24D330 0x5A5A5131, 1920x1080@60, 3840x1440, 1 # side monitor" - "monitor = desc:Panasonic Industry Company Panasonic-TV, 3840x2160@30, 0x0, 1 # tv" - ]; - }; - rofi.enable = true; - walker.enable = true; - wallpaper.enable = true; - }; - misc = { - bitwarden.enable = true; - }; + + # device = { + # type = "desktop"; + # }; + # development = { + # vscodium.enable = true; + # git.enable = true; + # }; + # terminal = { + # kitty.enable = true; + # }; + # desktop = { + # hyprland = { + # enable = false; + # numlock = true; + # monitors = [ + # "monitor = desc:AOC Q27G2WG4 0x00005F45, 2560x1440@144, 3840x0, 1 # main monitor" + # "monitor = desc:Samsung Electric Company S24D330 0x5A5A5131, 1920x1080@60, 3840x1440, 1 # side monitor" + # "monitor = desc:Panasonic Industry Company Panasonic-TV, 3840x2160@30, 0x0, 1 # tv" + # ]; + # }; + # rofi.enable = true; + # walker.enable = true; + # wallpaper.enable = true; + # }; + # misc = { + # bitwarden.enable = true; + # }; imports = [ inputs.walker.homeManagerModules.default diff --git a/modules/default.nix b/modules/default.nix index 4ef6678..40d269f 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -7,9 +7,11 @@ { imports = [ + ./defaults ./development ./terminal ./desktop ./misc + ./gaming ]; } diff --git a/modules/defaults/default.nix b/modules/defaults/default.nix new file mode 100644 index 0000000..279dc0c --- /dev/null +++ b/modules/defaults/default.nix @@ -0,0 +1,59 @@ +{ + config, + pkgs, + inputs, + lib, + ... +}: + +{ + options = { + device = { + type = { + laptop = lib.mkEnableOption "laptop"; + desktop = lib.mkEnableOption "desktop"; + server = lib.mkEnableOption "server"; + }; + }; + }; + imports = [ + ./laptop.nix + ./desktop.nix + ./server.nix + ]; + config = { + development = lib.mkDefault { + git.enable = true; + }; + terminal = lib.mkDefault { + ranger.enable = true; + }; + misc = lib.mkDefault{ + bitwarden.enable = true; + }; + syncthing = lib.mkDefault { + devices = { + marty-pc = { + id = "6PJZD52-EEWIO7U-MZMJJ5B-33DGNSU-O7DJVRT-GAE7QZG-ZY3VIMV-VSMBDQP"; + autoAcceptFolder = true; + }; + marty-server = { + id = "UDMXEKZ-HYIFI5S-VAKE75O-K3C65QV-LS43QA5-3JTHWKL-CI5C3Y6-P4NSQQM"; + autoAcceptFolders = true; + }; + marty-latitude = { + id = "SOAWHKA-BCQGO5G-IJ24WTO-RDETP5M-LNTVO66-MHIOUU2-NNQ57P6-FFKNSA6"; + autoAcceptFolders = true; + }; + marty-pixel = { + id = "GSBXOGW-6SYLDUQ-HPH7FBJ-CKHWQIK-K5YORB4-CYKGYT6-DLCVSAK-LA2RMAK"; + autoAcceptFolders = true; + }; + marty-fairphone = { + id = "2ISVWQV-4USY5IA-2OU55CE-Q7VLPD7-4RVQ5WX-FXQSJMY-2ES4EZG-IGFB7QG"; + autoAcceptFolders = true; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/defaults/desktop.nix b/modules/defaults/desktop.nix new file mode 100644 index 0000000..0e18fdd --- /dev/null +++ b/modules/defaults/desktop.nix @@ -0,0 +1,28 @@ +{ + config, + pkgs, + inputs, + lib, + ... +}: + +{ + config = lib.mkIf config.device.type.desktop { + development = lib.mkDefault { + vscodium.enable = true; + }; + terminal = lib.mkDefault { + kitty.enable = true; + }; + desktop = lib.mkDefault { + hyprland = { + enable = true; + numlock = true; + }; + waybar.enable = true; + walker.enable = true; + wallpaper.enable = true; + grimblast.enable = true; + }; + }; +} \ No newline at end of file diff --git a/modules/defaults/laptop.nix b/modules/defaults/laptop.nix new file mode 100644 index 0000000..fc10f5e --- /dev/null +++ b/modules/defaults/laptop.nix @@ -0,0 +1,30 @@ +{ + config, + pkgs, + inputs, + lib, + ... +}: + +{ + config = lib.mkIf config.device.type.laptop { + home.packages = with pkgs; [ + light + ]; + development = lib.mkDefault { + vscodium.enable = true; + }; + terminal = lib.mkDefault { + kitty.enable = true; + }; + desktop = lib.mkDefault { + hyprland = { + enable = true; + }; + waybar.enable = true; + walker.enable = true; + wallpaper.enable = true; + grimblast.enable = true; + }; + }; +} \ No newline at end of file diff --git a/modules/defaults/server.nix b/modules/defaults/server.nix new file mode 100644 index 0000000..e2c76af --- /dev/null +++ b/modules/defaults/server.nix @@ -0,0 +1,11 @@ +{ + config, + pkgs, + inputs, + lib, + ... +}: + +{ + +} \ No newline at end of file diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix index 5877896..9275dd3 100644 --- a/modules/desktop/hyprland.nix +++ b/modules/desktop/hyprland.nix @@ -16,6 +16,25 @@ ]; description = ''declare monitors''; }; + workspaces = { + workspaces = lib.mkOption { + default = ( + builtins.concatLists (builtins.genList (i: + let ws = i + 1; + in [ + "name:${toString i},,persistent:true" + ] + ) + config.desktop.hyprland.workspaces.amount) + ) + ; + description = ''declare workspace''; + }; + amount = lib.mkOption { + default = 9; + description = ''declare workspace amount''; + }; + }; numlock = lib.mkEnableOption "numlock by default"; }; }; @@ -36,6 +55,7 @@ enable = true; settings = { monitor = config.desktop.hyprland.monitors; + workspace = config.desktop.hyprland.workspaces.workspaces; exec-once = [ (lib.mkIf (config.desktop.walker.enable) "elephant") (lib.mkIf (config.desktop.waybar.enable) "waybar") @@ -43,7 +63,9 @@ ]; "$mod" = "SUPER"; "$shiftmod" = "SUPER_SHIFT"; + "$controlmod" = "SUPER_CTRL"; bind = [ + (lib.mkIf (config.desktop.walker.enable) "$mod, D, exec, walker") (lib.mkIf (config.desktop.rofi.enable) "$mod, D, exec, rofi -show drun") (lib.mkIf (config.terminal.kitty.enable) "$mod, return, exec, kitty") @@ -53,6 +75,46 @@ "$mod, F, fullscreen, 1" "$shiftmod, F, fullscreen, 0" "$shiftmod, Q, killactive," + "$mod, S, togglespecialworkspace, magic" + "$shiftmod, S, movetoworkspace, special:magic" + "$controlmod, right, workspace, m-1" + "$controlmod, left, workspace, m+1" + "$mod, mouse_down, workspace, m-1" + "$mod, mouse_up, workspace, m+1" + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + "$mod, J, exec, playerctl previous" + "$mod, K, exec, playerctl play-pause" + "$mod, L, exec, playerctl, next" + "$mod, G, togglefloating," + "$mod, F1, exec, hyprlock" + "$shiftmod, E, exec, codium" + "$controlmod, up, exec, light -A 10" + "$controlmod, down, exec, light -U 10" + "$controlmod, Q, exec, hyprctl kill" + ] + ++ ( + builtins.concatLists (builtins.genList (i: + let ws = i + 1; + in [ + "$mod, code:1${toString i}, workspace, ${toString ws}" + "$shiftmod, code:1${toString i}, movetoworkspacesilent, ${toString ws}" + ] + ) + config.desktop.hyprland.workspaces.amount) + ) + ; + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + binde = [ + ",XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+" + ]; + bindl = [ + ",XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" ]; input = { kb_layout = "de"; diff --git a/modules/gaming/default.nix b/modules/gaming/default.nix new file mode 100644 index 0000000..9e06180 --- /dev/null +++ b/modules/gaming/default.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + imports = [ + ./steam.nix + + ]; +} diff --git a/modules/gaming/steam.nix b/modules/gaming/steam.nix new file mode 100644 index 0000000..b86360e --- /dev/null +++ b/modules/gaming/steam.nix @@ -0,0 +1,18 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + options = { + gaming = { + steam.enable = lib.mkEnableOption "enable steam"; + }; + }; + + config = lib.mkIf config.gaming.steam.enable { + home.packages = with pkgs; [steam]; + }; +}