diff --git a/configuration.nix b/configuration.nix index 7bfc560..4b6ae41 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, inputs, ... }: { nix.settings.experimental-features = [ @@ -46,35 +46,14 @@ services.displayManager.defaultSession = "none+i3"; - # Configure keymap in X11 - services.xserver = { - xkb.layout = "de"; - xkb.variant = ""; - enable = true; - dpi = 120; - - displayManager = { - setupCommands = '' - ${pkgs.xorg.xrandr}/bin/xrandr --output eDP-1 --mode 3840x2160; - ''; - }; - - windowManager.i3 = { - enable = true; - package = pkgs.i3-gaps; - extraPackages = with pkgs; [ - dmenu - i3lock - ]; - }; - - desktopManager.wallpaper.mode = "fill"; - }; - imports = [ ./programm_configs/yubikey-gpg.nix ./printing/config.nix - ]; + + ] ++ (if inputs.x11mode then + [ ./programm_configs/x11.nix ] + else [ ]); + services.gvfs.enable = true; @@ -99,6 +78,12 @@ # GNOME Keyring services.gnome.gnome-keyring.enable = true; + # duplicati + services.duplicati = { + enable = true; + user = "clemens"; + }; + # PipeWire Setup security.rtkit.enable = true; services.pipewire = { @@ -127,7 +112,11 @@ # home manager home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.users.clemens = import ./home.nix; + home-manager.users.clemens = (import ./home.nix { + config = config; + pkgs = pkgs; + x11mode = inputs.x11mode; + }); # Allow unfree packages nixpkgs.config.allowUnfree = true; diff --git a/flake.nix b/flake.nix index 8101b2e..6f48a3f 100644 --- a/flake.nix +++ b/flake.nix @@ -17,8 +17,18 @@ home-manager.nixosModules.home-manager ]; }; - laptop = nixpkgs.lib.nixosSystem { + laptop-x11 = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; + specialArgs = let inputs.x11mode = true; in { inherit inputs; }; + modules = [ + ./configuration.nix + ./hardware_configuration.nix + home-manager.nixosModules.home-manager + ]; + }; + laptop-wayland = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = let inputs.x11mode = false; in { inherit inputs; }; modules = [ ./configuration.nix ./hardware_configuration.nix diff --git a/home.nix b/home.nix index 25e4cea..215daf0 100644 --- a/home.nix +++ b/home.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, x11mode, ... }: let tex = (pkgs.texlive.combine { inherit (pkgs.texlive) scheme-full; @@ -23,14 +23,13 @@ in ./programm_configs/git.nix ./programm_configs/vscode.nix ./programm_configs/rofi.nix - ./programm_configs/i3.nix ./programm_configs/picom.nix ./programm_configs/zsh.nix ./programm_configs/gnome.nix ./programm_configs/autorandr.nix ./programm_configs/polybar.nix ./programm_configs/redshift.nix - ]; + ] ++ (if x11mode then [ ./programm_configs/i3.nix ] else [ ]); # The home.packages option allows you to install Nix packages into your # environment. diff --git a/programm_configs/x11.nix b/programm_configs/x11.nix new file mode 100644 index 0000000..14433a2 --- /dev/null +++ b/programm_configs/x11.nix @@ -0,0 +1,26 @@ +{ config, pkgs, ... }: +{ + services.xserver = { + xkb.layout = "de"; + xkb.variant = ""; + enable = true; + dpi = 120; + + displayManager = { + setupCommands = '' + ${pkgs.xorg.xrandr}/bin/xrandr --output eDP-1 --mode 3840x2160; + ''; + }; + + windowManager.i3 = { + enable = true; + package = pkgs.i3-gaps; + extraPackages = with pkgs; [ + dmenu + i3lock + ]; + }; + + desktopManager.wallpaper.mode = "fill"; + }; +}