diff --git a/flake.nix b/flake.nix index 2578283..cc48432 100755 --- a/flake.nix +++ b/flake.nix @@ -44,13 +44,9 @@ canopus = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs outputs username;}; modules = [ + ./modules/nixos ./hosts/canopus - ./modules/nixos/desktop/awesome - ./modules/nixos/desktop/hyprland - ./modules/nixos/virtualisation - ./modules/nixos/steam.nix - home-manager.nixosModules.home-manager { home-manager.backupFileExtension = "backup"; @@ -59,9 +55,7 @@ home-manager.users.${username} = { imports = [ ./modules/home-manager - ./modules/home-manager/hyprland - ./modules/home-manager/waybar - ./home/tux + ./hosts/canopus/home.nix ]; }; } @@ -71,8 +65,8 @@ controller = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs outputs username;}; modules = [ + ./modules/nixos ./hosts/controller - ./modules/nixos/headscale.nix home-manager.nixosModules.home-manager { @@ -91,6 +85,7 @@ wsl = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs outputs username;}; modules = [ + ./modules/nixos ./hosts/wsl home-manager.nixosModules.home-manager diff --git a/hosts/canopus/default.nix b/hosts/canopus/default.nix index b4f1e21..9f6af80 100755 --- a/hosts/canopus/default.nix +++ b/hosts/canopus/default.nix @@ -1,53 +1,18 @@ { inputs, - outputs, pkgs, - username, ... }: { imports = [ inputs.nixos-hardware.nixosModules.asus-zephyrus-ga503 ./hardware-configuration.nix + ../../modules/nixos/desktop/awesome + ../../modules/nixos/desktop/hyprland + ../../modules/nixos/virtualisation + ../../modules/nixos/steam.nix ]; - nixpkgs = { - overlays = [ - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - outputs.overlays.nur - outputs.overlays.nix-vscode-extensions - ]; - - config = { - cudaSupport = true; - allowUnfree = true; - joypixels.acceptLicense = true; - }; - }; - - nix = { - settings = { - experimental-features = "nix-command flakes"; - auto-optimise-store = true; - }; - }; - - time.timeZone = "Asia/Kolkata"; - i18n = { - defaultLocale = "en_US.UTF-8"; - extraLocaleSettings = { - LC_ADDRESS = "en_IN"; - LC_IDENTIFICATION = "en_IN"; - LC_MEASUREMENT = "en_IN"; - LC_MONETARY = "en_IN"; - LC_NAME = "en_IN"; - LC_NUMERIC = "en_IN"; - LC_PAPER = "en_IN"; - LC_TELEPHONE = "en_IN"; - LC_TIME = "en_IN"; - }; - }; + nixpkgs.config.cudaSupport = true; networking = { hostName = "canopus"; @@ -122,7 +87,6 @@ programs = { ssh.startAgent = true; - zsh.enable = true; thunar = { enable = true; plugins = with pkgs.xfce; [thunar-archive-plugin thunar-volman]; @@ -132,26 +96,8 @@ noisetorch.enable = true; }; - users = { - defaultUserShell = pkgs.zsh; - users.${username} = { - initialPassword = "${username}"; - isNormalUser = true; - extraGroups = ["networkmanager" "wheel" "storage"]; - openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL+OzPUe2ECPC929DqpkM39tl/vdNAXfsRnmrGfR+X3D 0xtux@pm.me'' - ]; - }; - }; - services = { resolved.enable = true; - openssh = { - enable = true; - settings = { - PasswordAuthentication = false; - }; - }; pipewire = { enable = true; diff --git a/hosts/canopus/home.nix b/hosts/canopus/home.nix new file mode 100644 index 0000000..946bfb5 --- /dev/null +++ b/hosts/canopus/home.nix @@ -0,0 +1,51 @@ +{pkgs, ...}: { + imports = [ + ../../modules/home-manager/hyprland + ../../modules/home-manager/waybar + ../../modules/home-manager/picom + ../../modules/home-manager/alacritty + ../../modules/home-manager/wezterm + ../../modules/home-manager/rofi + ../../modules/home-manager/barrier + ../../modules/home-manager/firefox + ../../modules/home-manager/kdeconnect + ../../modules/home-manager/vs-code + ]; + + home.pointerCursor = { + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Ice"; + }; + + qt.enable = true; + qt.platformTheme = "gtk"; + qt.style.name = "adwaita-dark"; + qt.style.package = pkgs.adwaita-qt; + + gtk = { + enable = true; + theme = { + name = "Materia-dark"; + package = pkgs.materia-theme; + }; + iconTheme = { + package = pkgs.tela-icon-theme; + name = "Tela-black"; + }; + }; + + home.packages = with pkgs; [ + discord + telegram-desktop + anydesk + rustdesk-flutter + vlc + darktable + rawtherapee + beekeeper-studio + gimp + obs-studio + flameshot + chromium + ]; +} diff --git a/hosts/controller/default.nix b/hosts/controller/default.nix index ba183a9..17494b9 100644 --- a/hosts/controller/default.nix +++ b/hosts/controller/default.nix @@ -6,6 +6,7 @@ }: { imports = [ ./hardware-configuration.nix + ../../modules/nixos/headscale.nix ]; nixpkgs = { diff --git a/hosts/controller/home.nix b/hosts/controller/home.nix new file mode 100644 index 0000000..e69de29 diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 2c27a91..df98319 100755 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -1,23 +1,13 @@ { outputs, - pkgs, username, ... }: { imports = [ - ./picom ./shell ./git - ./alacritty - ./wezterm ./starship - ./rofi ./nvim - ./barrier - ./firefox - ./kdeconnect - ./vs-code - ./bitwarden ./tmux ./helix ]; @@ -41,28 +31,6 @@ home = { username = "${username}"; homeDirectory = "/home/${username}"; - - pointerCursor = { - package = pkgs.bibata-cursors; - name = "Bibata-Modern-Ice"; - }; - }; - - qt.enable = true; - qt.platformTheme = "gtk"; - qt.style.name = "adwaita-dark"; - qt.style.package = pkgs.adwaita-qt; - - gtk = { - enable = true; - theme = { - name = "Materia-dark"; - package = pkgs.materia-theme; - }; - iconTheme = { - package = pkgs.tela-icon-theme; - name = "Tela-black"; - }; }; programs.home-manager.enable = true; diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix new file mode 100644 index 0000000..f164965 --- /dev/null +++ b/modules/nixos/default.nix @@ -0,0 +1,75 @@ +{ + pkgs, + username, + outputs, + ... +}: { + nixpkgs = { + overlays = [ + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + outputs.overlays.nur + outputs.overlays.nix-vscode-extensions + ]; + + config = { + allowUnfree = true; + joypixels.acceptLicense = true; + }; + }; + + nix = { + settings = { + experimental-features = "nix-command flakes"; + auto-optimise-store = true; + }; + }; + + time.timeZone = "Asia/Kolkata"; + i18n = { + defaultLocale = "en_US.UTF-8"; + extraLocaleSettings = { + LC_ADDRESS = "en_IN"; + LC_IDENTIFICATION = "en_IN"; + LC_MEASUREMENT = "en_IN"; + LC_MONETARY = "en_IN"; + LC_NAME = "en_IN"; + LC_NUMERIC = "en_IN"; + LC_PAPER = "en_IN"; + LC_TELEPHONE = "en_IN"; + LC_TIME = "en_IN"; + }; + }; + + programs = { + zsh.enable = true; + nh = { + enable = true; + clean.enable = true; + clean.extraArgs = "--keep-since 5d --keep 5"; + flake = "/home/${username}/Projects/nixos-config"; + }; + }; + + services = { + openssh = { + enable = true; + settings = { + PasswordAuthentication = false; + }; + }; + }; + + users = { + defaultUserShell = pkgs.zsh; + users.${username} = { + initialPassword = "${username}"; + isNormalUser = true; + extraGroups = ["networkmanager" "wheel" "storage"]; + openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL+OzPUe2ECPC929DqpkM39tl/vdNAXfsRnmrGfR+X3D 0xtux@pm.me'' + ]; + }; + }; +}