From 56ede7e44bd5abc57acb7f56d452d9aa3d909d6e Mon Sep 17 00:00:00 2001 From: thiloho <123883702+thiloho@users.noreply.github.com> Date: Wed, 10 May 2023 19:59:21 +0200 Subject: [PATCH] Change configuration structure for second device --- flake.nix | 17 +++++++++++++++-- nixos-configurations/laptop/default.nix | 11 +++++++++++ nixos-configurations/pc/default.nix | 14 ++++++++++++++ .../pc/hardware-configuration.nix | 0 .../shared.nix | 11 +++-------- 5 files changed, 43 insertions(+), 10 deletions(-) create mode 100644 nixos-configurations/laptop/default.nix create mode 100644 nixos-configurations/pc/default.nix rename hardware-configuration.nix => nixos-configurations/pc/hardware-configuration.nix (100%) rename configuration.nix => nixos-configurations/shared.nix (88%) diff --git a/flake.nix b/flake.nix index 2c06c91..af9d916 100644 --- a/flake.nix +++ b/flake.nix @@ -9,10 +9,23 @@ outputs = inputs@{ nixpkgs, home-manager, ... }: { nixosConfigurations = { - itachi = nixpkgs.lib.nixosSystem { + pc = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./configuration.nix + ./nixos-configurations/pc + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + }; + } + ]; + }; + laptop = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./nixos-configurations/laptop home-manager.nixosModules.home-manager { home-manager = { diff --git a/nixos-configurations/laptop/default.nix b/nixos-configurations/laptop/default.nix new file mode 100644 index 0000000..038d2b4 --- /dev/null +++ b/nixos-configurations/laptop/default.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ../shared.nix + ]; + + networking.hostName = "laptop"; +} diff --git a/nixos-configurations/pc/default.nix b/nixos-configurations/pc/default.nix new file mode 100644 index 0000000..35e9aba --- /dev/null +++ b/nixos-configurations/pc/default.nix @@ -0,0 +1,14 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ../shared.nix + ]; + + services.xserver.windowManager.i3.extraSessionCommands = "xrandr --output DP-0 --left-of DP-4 --mode 1920x1080 --rate 144 --output DP-4 --mode 1920x1080 --rate 144"; + + networking.hostName = "pc"; +} + diff --git a/hardware-configuration.nix b/nixos-configurations/pc/hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to nixos-configurations/pc/hardware-configuration.nix diff --git a/configuration.nix b/nixos-configurations/shared.nix similarity index 88% rename from configuration.nix rename to nixos-configurations/shared.nix index 6099fb0..7a4f7d7 100644 --- a/configuration.nix +++ b/nixos-configurations/shared.nix @@ -1,11 +1,6 @@ { config, pkgs, ... }: { - imports = - [ - ./hardware-configuration.nix - ]; - boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -13,8 +8,6 @@ nix.settings.experimental-features = [ "nix-command" "flakes" ]; - networking.hostName = "itachi"; - time.timeZone = "Europe/Amsterdam"; services = { @@ -23,7 +16,6 @@ videoDrivers = [ "nvidia" ]; windowManager.i3 = { enable = true; - extraSessionCommands = "xrandr --output DP-0 --left-of DP-4 --mode 1920x1080 --rate 144 --output DP-4 --mode 1920x1080 --rate 144"; }; }; pipewire = { @@ -86,6 +78,9 @@ services.flameshot.enable = true; home = { stateVersion = "22.11"; + packages = with pkgs; [ + zoom-us + ]; }; };