From 8aacb14fcab1ef1efd0458fb4a97e81ec852f472 Mon Sep 17 00:00:00 2001 From: Devin Finlinson Date: Tue, 3 Oct 2023 03:29:21 -0600 Subject: i've gone mad with power / attempted config from misterio77 to fix inputs errors // this created the default.nix files and commented out block in flake.nix // didn't work, misterio is insane / but misterio's nix-colors github tells you to pass it as a special arg into home-manager // was confused for a bit but got it as an extraSpecialArg cause of module bullshit /// good thing i had that old note or i'd have been stuck / now the inputs pass into home-manager // hoping to find a more elegant passthrough format / oh also moved home-manager's modules to modules folder because misterio does // probably because they're crazy but also because they've gone so deep it's somehow necessary for anything to work /// idk how or why, should have something to do with replacing/following default nix format? //// thus the default.nix files to add/override defaults? this is my longest commit message ever --- flake.lock | 99 ++++++++++++++++++++++----------- flake.nix | 113 ++++++++++++++++++++++++++++++-------- home-manager/btop.nix | 12 ---- home-manager/helix.nix | 25 --------- home-manager/home.nix | 8 +-- home-manager/shell.nix | 12 ---- home-manager/starship.nix | 11 ---- modules/bluetooth.nix | 12 ---- modules/environment.nix | 18 ------ modules/home-manager/btop.nix | 12 ++++ modules/home-manager/default.nix | 6 ++ modules/home-manager/helix.nix | 25 +++++++++ modules/home-manager/shell.nix | 12 ++++ modules/home-manager/starship.nix | 11 ++++ modules/hyprland.nix | 3 - modules/kde-connect.nix | 7 --- modules/nix-common.nix | 19 ------- modules/nixos/bluetooth.nix | 12 ++++ modules/nixos/default.nix | 11 ++++ modules/nixos/environment.nix | 18 ++++++ modules/nixos/hyprland.nix | 3 + modules/nixos/kde-connect.nix | 7 +++ modules/nixos/nix-common.nix | 19 +++++++ modules/nixos/services.nix | 50 +++++++++++++++++ modules/nixos/steam.nix | 7 +++ modules/nixos/sway.nix | 40 ++++++++++++++ modules/nixos/system-packages.nix | 78 ++++++++++++++++++++++++++ modules/services.nix | 50 ----------------- modules/steam.nix | 7 --- modules/sway.nix | 40 -------------- modules/system-packages.nix | 78 -------------------------- 31 files changed, 472 insertions(+), 353 deletions(-) delete mode 100644 home-manager/btop.nix delete mode 100644 home-manager/helix.nix delete mode 100644 home-manager/shell.nix delete mode 100644 home-manager/starship.nix delete mode 100644 modules/bluetooth.nix delete mode 100644 modules/environment.nix create mode 100644 modules/home-manager/btop.nix create mode 100644 modules/home-manager/default.nix create mode 100644 modules/home-manager/helix.nix create mode 100644 modules/home-manager/shell.nix create mode 100644 modules/home-manager/starship.nix delete mode 100644 modules/hyprland.nix delete mode 100644 modules/kde-connect.nix delete mode 100644 modules/nix-common.nix create mode 100644 modules/nixos/bluetooth.nix create mode 100644 modules/nixos/default.nix create mode 100644 modules/nixos/environment.nix create mode 100644 modules/nixos/hyprland.nix create mode 100644 modules/nixos/kde-connect.nix create mode 100644 modules/nixos/nix-common.nix create mode 100644 modules/nixos/services.nix create mode 100644 modules/nixos/steam.nix create mode 100644 modules/nixos/sway.nix create mode 100644 modules/nixos/system-packages.nix delete mode 100644 modules/services.nix delete mode 100644 modules/steam.nix delete mode 100644 modules/sway.nix delete mode 100644 modules/system-packages.nix diff --git a/flake.lock b/flake.lock index e59e5c3..8e7f882 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "base16-schemes": { + "flake": false, + "locked": { + "lastModified": 1689473676, + "narHash": "sha256-L0RhUr9+W5EPWBpLcmkKpUeCEWRs/kLzVMF3Vao2ZU0=", + "owner": "tinted-theming", + "repo": "base16-schemes", + "rev": "d95123ca6377cd849cfdce92c0a24406b0c6a789", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-schemes", + "type": "github" + } + }, "catppuccin-alacritty": { "flake": false, "locked": { @@ -120,17 +136,19 @@ "hyprland": { "inputs": { "hyprland-protocols": "hyprland-protocols", - "nixpkgs": "nixpkgs", + "nixpkgs": [ + "nixpkgs-unstable" + ], "systems": "systems", "wlroots": "wlroots", "xdph": "xdph" }, "locked": { - "lastModified": 1696036148, - "narHash": "sha256-7KCxZLMEQhjQXZVqVPZCxUR3lE+Z5heU7MmQjEtFFqU=", + "lastModified": 1696261738, + "narHash": "sha256-ujhtnd7vCZHJosOxTi4lgIyHA6iblYwXhx+ZS678fxw=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "86e8ed038f5b195cdf2548bc469f8f8bbc0caca8", + "rev": "b784931e678f907b1f1e41d04485fefd8a1faaf8", "type": "github" }, "original": { @@ -164,50 +182,68 @@ "type": "github" } }, - "nixpkgs": { + "nix-colors": { + "inputs": { + "base16-schemes": "base16-schemes", + "nixpkgs-lib": "nixpkgs-lib" + }, "locked": { - "lastModified": 1694767346, - "narHash": "sha256-5uH27SiVFUwsTsqC5rs3kS7pBoNhtoy9QfTP9BmknGk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "ace5093e36ab1e95cb9463863491bee90d5a4183", + "lastModified": 1695388192, + "narHash": "sha256-2jelpE7xK+4M7jZNyWL7QYOYegQLYBDQS5bvdo8XRUQ=", + "owner": "misterio77", + "repo": "nix-colors", + "rev": "37227f274b34a3b51649166deb94ce7fec2c6a4c", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", + "owner": "misterio77", + "repo": "nix-colors", "type": "github" } }, - "nixpkgs-unstable": { + "nixpkgs": { "locked": { - "lastModified": 1695830400, - "narHash": "sha256-gToZXQVr0G/1WriO83olnqrLSHF2Jb8BPcmCt497ro0=", + "lastModified": 1696039360, + "narHash": "sha256-g7nIUV4uq1TOVeVIDEZLb005suTWCUjSY0zYOlSBsyE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "8a86b98f0ba1c405358f1b71ff8b5e1d317f5db2", + "rev": "32dcb45f66c0487e92db8303a798ebc548cadedc", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable", + "ref": "nixos-23.05", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_2": { + "nixpkgs-lib": { "locked": { - "lastModified": 1695825837, - "narHash": "sha256-4Ne11kNRnQsmSJCRSSNkFRSnHC4Y5gPDBIQGjjPfJiU=", + "lastModified": 1694911725, + "narHash": "sha256-8YqI+YU1DGclEjHsnrrGfqsQg3Wyga1DfTbJrN3Ud0c=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "819180647f428a3826bfc917a54449da1e532ce0", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1696019113, + "narHash": "sha256-X3+DKYWJm93DRSdC5M6K5hLqzSya9BjibtBsuARoPco=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5cfafa12d57374f48bcc36fda3274ada276cf69e", + "rev": "f5892ddac112a1e9b3612c39af1b72987ee5783a", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-23.05", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -215,11 +251,11 @@ "nushell-scripts": { "flake": false, "locked": { - "lastModified": 1695747169, - "narHash": "sha256-Z2WZxgUB5zMMkz+C5iidB1LH4H5XLmd0nhx88TsxvNU=", + "lastModified": 1696266728, + "narHash": "sha256-1YPrrapNBvXEkEHvT57JTKMDH0Af71/5OgYEWJ973U0=", "owner": "nushell", "repo": "nu_scripts", - "rev": "694701430662f08071cc1b88cb3fa438539c39ea", + "rev": "dae6115d4de2f5f8de976adebbf3b725ed531f07", "type": "github" }, "original": { @@ -238,7 +274,8 @@ "catppuccin-starship": "catppuccin-starship", "home-manager": "home-manager", "hyprland": "hyprland", - "nixpkgs": "nixpkgs_2", + "nix-colors": "nix-colors", + "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "nushell-scripts": "nushell-scripts", "wallpapers": "wallpapers" @@ -279,18 +316,18 @@ "flake": false, "locked": { "host": "gitlab.freedesktop.org", - "lastModified": 1695919988, - "narHash": "sha256-4RBgIZHaVqH0m1POnfzYRzwCWxifIKH4xQ0kCn2LGkA=", + "lastModified": 1696255886, + "narHash": "sha256-0KZfiqqREousitBgG1mkzKmmNX4tjOIWdbBm6MvRCjQ=", "owner": "wlroots", "repo": "wlroots", - "rev": "c2aa7fd965cb7ee8bed24f4122b720aca8f0fc1e", + "rev": "5ef42e8e8adece098848fac53c721b6eb3818fc2", "type": "gitlab" }, "original": { "host": "gitlab.freedesktop.org", "owner": "wlroots", "repo": "wlroots", - "rev": "c2aa7fd965cb7ee8bed24f4122b720aca8f0fc1e", + "rev": "5ef42e8e8adece098848fac53c721b6eb3818fc2", "type": "gitlab" } }, diff --git a/flake.nix b/flake.nix index b492f96..e24d71d 100644 --- a/flake.nix +++ b/flake.nix @@ -14,7 +14,13 @@ }; # modern window compositor - hyprland.url = "github:hyprwm/Hyprland"; + # hyprland.url = "github:hyprwm/Hyprland"; + hyprland = { + url = "github:hyprwm/Hyprland"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; + + nix-colors.url = "github:misterio77/nix-colors"; #community wayland nixpkgs # nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland"; @@ -126,10 +132,63 @@ }; - # outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, hyprland, ... }: { - outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, wallpapers, catppuccin-btop, catppuccin-bat, catppuccin-alacritty, catppuccin-starship, catppuccin-hyprland, ... }: { - # outputs = inputs@{ self, ...}: with inputs; { - + # outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, nix-colors, ... }: { + # outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, wallpapers, nix-colors, catppuccin-btop, catppuccin-bat, catppuccin-alacritty, catppuccin-starship, catppuccin-hyprland, ... }: { + outputs = inputs@{ self, ...}: with inputs; { + # outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, ... }@inputs: + # let + # inherit (self) outputs; + # lib = nixpkgs.lib //home-manager.lib; + # systems = [ "x86_64-linux" ]; + # forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system}); + # pkgsFor = lib.genAttrs systems (system: import nixpkgs { + # inherit system; + # config.allowUnfreee = true; + # }); + # in { + # inherit lib; + # nixosModules = import ./modules/nixos; + # homeManagerModules = import ./modules/home-manager; + # # templates = import ./templates; + + # # overlays = import ./overlays { inherit inputs outputs; }; + # # hydraJobs = import ./hydra.nix { inherit inputs outputs; }; + + # packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; }); + # # devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; }); + # # formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt); + + # # wallpapers = inherit wallpapers; #NOTE broken + + # nixosConfigurations = { + # # Main desktop + # khad = lib.nixosSystem { + # modules = [ ./machines/khad ]; + # specialArgs = { inherit inputs outputs; }; + # }; + # # Personal laptop + # nixos-zenbook = lib.nixosSystem { + # modules = [ ./machines/khad ]; + # specialArgs = { inherit inputs outputs; }; + # }; + # }; + + # homeConfigurations = { + # # Desktop + # "defin@khad" = lib.homeManagerConfiguration { + # modules = [ ./home-manager/home.nix ]; + # pkgs = pkgsFor.x86_64-linux; + # extraSpecialArgs = { inherit inputs outputs; }; + # }; + # # Laptop + # "defin@nixos-zenbook" = lib.homeManagerConfiguration { + # modules = [ ./home-manager/home.nix ]; + # pkgs = pkgsFor.x86_64-linux; + # extraSpecialArgs = { inherit inputs outputs; }; + # }; + # }; + # }; + nixosConfigurations = { nixos-zenbook = nixpkgs.lib.nixosSystem { @@ -149,21 +208,24 @@ home-manager.useUserPackages = true; home-manager.users.defin = import ./home-manager/home.nix; + home-manager.extraSpecialArgs = { inherit nix-colors catppuccin-btop catppuccin-helix catppuccin-starship; }; + # home-manager.extraSpecialArgs = { inherit (self) outputs; }; + # Optionally, use home-manager.extraSpecialArgs to pass # arguments to home.nix } # hyprland.homeManagerModules.default {wayland.windowManager.hyprland.enable = true;} - ./modules/hyprland.nix + ./modules/nixos/hyprland.nix - ./modules/bluetooth.nix - ./modules/environment.nix - ./modules/kde-connect.nix - ./modules/nix-common.nix - ./modules/services.nix - ./modules/steam.nix - ./modules/sway.nix - ./modules/system-packages.nix + ./modules/nixos/bluetooth.nix + ./modules/nixos/environment.nix + ./modules/nixos/kde-connect.nix + ./modules/nixos/nix-common.nix + ./modules/nixos/services.nix + ./modules/nixos/steam.nix + ./modules/nixos/sway.nix + ./modules/nixos/system-packages.nix # ./home-manager/home.nix @@ -171,6 +233,7 @@ # system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; # nix.registry.nixpkgs.flake = nixpkgs; ]; + # specialArgs = { inherit inputs; }; }; khad = nixpkgs.lib.nixosSystem { @@ -185,17 +248,19 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.defin = import ./home-manager/home.nix; + home-manager.extraSpecialArgs = { inherit nix-colors catppuccin-btop catppuccin-helix catppuccin-starship; }; + # home-manager.extraSpecialArgs = { inherit (self) outputs; }; } - ./modules/hyprland.nix - - ./modules/bluetooth.nix - ./modules/environment.nix - ./modules/kde-connect.nix - ./modules/nix-common.nix - ./modules/services.nix - ./modules/steam.nix - ./modules/sway.nix - ./modules/system-packages.nix + ./modules/nixos/hyprland.nix + + ./modules/nixos/bluetooth.nix + ./modules/nixos/environment.nix + ./modules/nixos/kde-connect.nix + ./modules/nixos/nix-common.nix + ./modules/nixos/services.nix + ./modules/nixos/steam.nix + ./modules/nixos/sway.nix + ./modules/nixos/system-packages.nix ]; }; }; diff --git a/home-manager/btop.nix b/home-manager/btop.nix deleted file mode 100644 index 2c4e6cc..0000000 --- a/home-manager/btop.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ catppuccin-btop, ... }: { - home.file.".config/btop/themes".source = "${catppuccin-btop}/themes"; - - #replace htop/nmon - programs.btop = { - enable = true; - settings = { - color_theme = "catppuccin_mocha"; - theme_background = false; # make btop transparent - }; - }; -} diff --git a/home-manager/helix.nix b/home-manager/helix.nix deleted file mode 100644 index a8891a5..0000000 --- a/home-manager/helix.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ pkgs, catppuccin-helix, ... }: { - # https://github.com/catppuccin/helix - xdg.configFile."helix/themes".source = "${catppuccin-helix}/themes/default"; - - programs.helix = { - enable = true; - package = pkgs.helix; - # defaultEditor = true; - settings = { - theme = "catppuccin_mocha"; - editor = { - line-number = "relative"; - cursorline = true; - color-modes = true; - lsp.display-messages = true; - cursor.shape = { - insert = "bar"; - normal = "block"; - select = "underline"; - }; - indent-guides.render = true; - }; - }; - }; -} diff --git a/home-manager/home.nix b/home-manager/home.nix index 898a7e5..fcc29fd 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -5,10 +5,10 @@ # in { imports = [ - ./starship.nix - ./btop.nix - ./helix.nix - ./shell.nix + ../modules/home-manager/starship.nix + ../modules/home-manager/btop.nix + ../modules/home-manager/helix.nix + ../modules/home-manager/shell.nix ]; nixpkgs = { diff --git a/home-manager/shell.nix b/home-manager/shell.nix deleted file mode 100644 index c86190e..0000000 --- a/home-manager/shell.nix +++ /dev/null @@ -1,12 +0,0 @@ -{nushell-scripts, ... }: { - programs.nushell = { - extraConfig = '' - use ${nushell-scripts}/custom-completions/pass/pass-completions.nu * - use ${nushell-scripts}/custom-completions/nix/nix-completions.nu * - use ${nushell-scripts}/custom-completions/man/man-completions.nu * - use ${nushell-scripts}/custom-completions/cargo/cargo-completions.nu * - use ${nushell-scripts}/custom-completions/make/make-completions.nu * - use ${nushell-scripts}/custom-completions/git/git-completions.nu * - ''; - }; -} diff --git a/home-manager/starship.nix b/home-manager/starship.nix deleted file mode 100644 index 3a1f085..0000000 --- a/home-manager/starship.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ catppuccin-starship, ... }: { - programs.starship = { - enable = true; - - settings = { - command_timeout = 1000; - - palette = "catppuccin_mocha"; - } ;#// builtins.fromTOML (builtins.readFile "${catppuccin-starship}/palettes/mocha.toml"); - }; -} \ No newline at end of file diff --git a/modules/bluetooth.nix b/modules/bluetooth.nix deleted file mode 100644 index 36e8f8f..0000000 --- a/modules/bluetooth.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ config, pkgs, lib, ... }: { - - hardware.bluetooth = { - enable = true; - # config = " - # [General] - # Enable=Source,Sink,Media,Socket - # "; - }; - - services.blueman.enable = true; -} diff --git a/modules/environment.nix b/modules/environment.nix deleted file mode 100644 index 225ddda..0000000 --- a/modules/environment.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, lib, ... }: { - environment = { - # include user channels in NIX_PATH - # shellInit = ''export NIXPATH="/nix/var/nix/profiles/per-user/$USER/channels:nixos-config=/etc/nixos/machines/zenbook/configuration.nix"''; - # List packages installed in system profile. To search, run: - # $ nix search wget - sessionVariables = { - NIXOS_OZONE_WL = "1"; - }; - variables = { - # PATH = "/home/defin/.local/share/gem/ruby/3.0.0/bin:"; - # PAGER = "sh -c 'col -bx | bat -f'"; - MANPAGER = "sh -c 'col -bx | bat -l man -p'"; - EDITOR = "hx"; - ZEIT_DB = "/home/defin/Documents/zeit"; - }; - }; -} diff --git a/modules/home-manager/btop.nix b/modules/home-manager/btop.nix new file mode 100644 index 0000000..2c4e6cc --- /dev/null +++ b/modules/home-manager/btop.nix @@ -0,0 +1,12 @@ +{ catppuccin-btop, ... }: { + home.file.".config/btop/themes".source = "${catppuccin-btop}/themes"; + + #replace htop/nmon + programs.btop = { + enable = true; + settings = { + color_theme = "catppuccin_mocha"; + theme_background = false; # make btop transparent + }; + }; +} diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix new file mode 100644 index 0000000..132d201 --- /dev/null +++ b/modules/home-manager/default.nix @@ -0,0 +1,6 @@ +{ + btop = import ./btop.nix; + helix = import ./helix.nix; + shell = import ./shell.nix; + starship = import ./starship.nix; +} diff --git a/modules/home-manager/helix.nix b/modules/home-manager/helix.nix new file mode 100644 index 0000000..a8891a5 --- /dev/null +++ b/modules/home-manager/helix.nix @@ -0,0 +1,25 @@ +{ pkgs, catppuccin-helix, ... }: { + # https://github.com/catppuccin/helix + xdg.configFile."helix/themes".source = "${catppuccin-helix}/themes/default"; + + programs.helix = { + enable = true; + package = pkgs.helix; + # defaultEditor = true; + settings = { + theme = "catppuccin_mocha"; + editor = { + line-number = "relative"; + cursorline = true; + color-modes = true; + lsp.display-messages = true; + cursor.shape = { + insert = "bar"; + normal = "block"; + select = "underline"; + }; + indent-guides.render = true; + }; + }; + }; +} diff --git a/modules/home-manager/shell.nix b/modules/home-manager/shell.nix new file mode 100644 index 0000000..c86190e --- /dev/null +++ b/modules/home-manager/shell.nix @@ -0,0 +1,12 @@ +{nushell-scripts, ... }: { + programs.nushell = { + extraConfig = '' + use ${nushell-scripts}/custom-completions/pass/pass-completions.nu * + use ${nushell-scripts}/custom-completions/nix/nix-completions.nu * + use ${nushell-scripts}/custom-completions/man/man-completions.nu * + use ${nushell-scripts}/custom-completions/cargo/cargo-completions.nu * + use ${nushell-scripts}/custom-completions/make/make-completions.nu * + use ${nushell-scripts}/custom-completions/git/git-completions.nu * + ''; + }; +} diff --git a/modules/home-manager/starship.nix b/modules/home-manager/starship.nix new file mode 100644 index 0000000..7869b4c --- /dev/null +++ b/modules/home-manager/starship.nix @@ -0,0 +1,11 @@ +{ catppuccin-starship, ... }: { + programs.starship = { + enable = true; + + settings = { + command_timeout = 1000; + + palette = "catppuccin_mocha"; + } ; #// builtins.fromTOML (builtins.readFile "${catppuccin-starship}/palettes/mocha.toml"); + }; +} \ No newline at end of file diff --git a/modules/hyprland.nix b/modules/hyprland.nix deleted file mode 100644 index c754eae..0000000 --- a/modules/hyprland.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ config, lib, ...}: { - programs.hyprland.enable = true; -} \ No newline at end of file diff --git a/modules/kde-connect.nix b/modules/kde-connect.nix deleted file mode 100644 index 3705c44..0000000 --- a/modules/kde-connect.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, lib, ... }: { - networking.firewall = { - allowedTCPPortRanges = [ { from = 1714; to = 1764; } ]; - allowedUDPPortRanges = [ { from = 1714; to = 1764; } ]; - }; - programs.kdeconnect.enable = true; -} diff --git a/modules/nix-common.nix b/modules/nix-common.nix deleted file mode 100644 index 6e4d373..0000000 --- a/modules/nix-common.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, pkgs, ... }: { - - nix = { - settings = { - allowed-users = [ "@wheel" "@builders" "@video" ]; - experimental-features = [ "nix-command" "flakes" ]; - }; - - # Clean up old generations after 30 days - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; - - # Users allowed to run nix - # allowedUsers = [ "root" ]; - }; -} diff --git a/modules/nixos/bluetooth.nix b/modules/nixos/bluetooth.nix new file mode 100644 index 0000000..36e8f8f --- /dev/null +++ b/modules/nixos/bluetooth.nix @@ -0,0 +1,12 @@ +{ config, pkgs, lib, ... }: { + + hardware.bluetooth = { + enable = true; + # config = " + # [General] + # Enable=Source,Sink,Media,Socket + # "; + }; + + services.blueman.enable = true; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix new file mode 100644 index 0000000..a6d62e3 --- /dev/null +++ b/modules/nixos/default.nix @@ -0,0 +1,11 @@ +{ + bluetooth = import ./bluetooth.nix; + environment = import ./environment.nix; + hyprland = import ./hyprland.nix; + kde-connect = import ./kde-connect.nix; + nix-common = import ./nix-common.nix; + services = import ./services.nix; + steam = import ./steam.nix; + sway = import ./sway.nix; + system-packages = import ./system-packages.nix; +} diff --git a/modules/nixos/environment.nix b/modules/nixos/environment.nix new file mode 100644 index 0000000..225ddda --- /dev/null +++ b/modules/nixos/environment.nix @@ -0,0 +1,18 @@ +{ config, lib, ... }: { + environment = { + # include user channels in NIX_PATH + # shellInit = ''export NIXPATH="/nix/var/nix/profiles/per-user/$USER/channels:nixos-config=/etc/nixos/machines/zenbook/configuration.nix"''; + # List packages installed in system profile. To search, run: + # $ nix search wget + sessionVariables = { + NIXOS_OZONE_WL = "1"; + }; + variables = { + # PATH = "/home/defin/.local/share/gem/ruby/3.0.0/bin:"; + # PAGER = "sh -c 'col -bx | bat -f'"; + MANPAGER = "sh -c 'col -bx | bat -l man -p'"; + EDITOR = "hx"; + ZEIT_DB = "/home/defin/Documents/zeit"; + }; + }; +} diff --git a/modules/nixos/hyprland.nix b/modules/nixos/hyprland.nix new file mode 100644 index 0000000..c754eae --- /dev/null +++ b/modules/nixos/hyprland.nix @@ -0,0 +1,3 @@ +{ config, lib, ...}: { + programs.hyprland.enable = true; +} \ No newline at end of file diff --git a/modules/nixos/kde-connect.nix b/modules/nixos/kde-connect.nix new file mode 100644 index 0000000..3705c44 --- /dev/null +++ b/modules/nixos/kde-connect.nix @@ -0,0 +1,7 @@ +{ config, lib, ... }: { + networking.firewall = { + allowedTCPPortRanges = [ { from = 1714; to = 1764; } ]; + allowedUDPPortRanges = [ { from = 1714; to = 1764; } ]; + }; + programs.kdeconnect.enable = true; +} diff --git a/modules/nixos/nix-common.nix b/modules/nixos/nix-common.nix new file mode 100644 index 0000000..6e4d373 --- /dev/null +++ b/modules/nixos/nix-common.nix @@ -0,0 +1,19 @@ +{ config, pkgs, ... }: { + + nix = { + settings = { + allowed-users = [ "@wheel" "@builders" "@video" ]; + experimental-features = [ "nix-command" "flakes" ]; + }; + + # Clean up old generations after 30 days + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + + # Users allowed to run nix + # allowedUsers = [ "root" ]; + }; +} diff --git a/modules/nixos/services.nix b/modules/nixos/services.nix new file mode 100644 index 0000000..336d132 --- /dev/null +++ b/modules/nixos/services.nix @@ -0,0 +1,50 @@ +{ config, pkgs, ... }: +{ + services = { + pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + }; + spotifyd.enable = true; + + #FOR: sway + dbus.enable = true; + + #FROM: configuration.nix + # localtimed.enable = true; + xserver = { + # Enable the X11 windowing system. + enable = true; + + # Enable touchpad support (enabled default in most desktopManager). + libinput.enable = true; + + # Configure keymap in X11 + # layout = "us"; + # xkbOptions = "eurosign:e,caps:escape"; + + # Enable the Plasma 5 Desktop Environment. + desktopManager.plasma5.enable = true; + displayManager = { + sddm.enable = true; + defaultSession = "plasmawayland"; + }; + }; + + # Enable CUPS to print documents. + printing = { + enable = true; + drivers = with pkgs; [ epson-escpr gutenprint ]; + }; + avahi = { + enable = true; + nssmdns = true; + # for a WiFi printer + openFirewall = true; + }; + + # Enable the OpenSSH daemon. + # openssh.enable = true; + }; +} diff --git a/modules/nixos/steam.nix b/modules/nixos/steam.nix new file mode 100644 index 0000000..91c5b67 --- /dev/null +++ b/modules/nixos/steam.nix @@ -0,0 +1,7 @@ +{ config, ... }: { + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + # dedicatedServer.openfirewall = true; + }; +} diff --git a/modules/nixos/sway.nix b/modules/nixos/sway.nix new file mode 100644 index 0000000..8d4d664 --- /dev/null +++ b/modules/nixos/sway.nix @@ -0,0 +1,40 @@ +{ config, pkgs, lib, ... }: +{ + environment.systemPackages = with pkgs; [ + ]; + + # xdg-desktop-portal works by exposing a series of D-Bus interfaces + # known as portals under a well-known name + # (org.freedesktop.portal.Desktop) and object path + # (/org/freedesktop/portal/desktop). + # The portal interfaces include APIs for file access, opening URIs, + # printing and others. + xdg.portal = { + enable = true; + wlr.enable = true; + # gtk portal needed to make gtk apps happy + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; + + # enable sway window manager + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + }; + + # kanshi systemd service + systemd.user.services.kanshi = { + description = "kanshi daemon"; + serviceConfig = { + Type = "simple"; + ExecStart = ''${pkgs.kanshi}/bin/kanshi -c kanshi_config_file''; + }; + }; + + security.pam.services.swaylock.text = '' + # PAM configuration file for the swaylock screen locker. By default, it includes + # the 'login' configuration file (see /etc/pam.d/login) + auth include login + ''; +} + diff --git a/modules/nixos/system-packages.nix b/modules/nixos/system-packages.nix new file mode 100644 index 0000000..1ffa540 --- /dev/null +++ b/modules/nixos/system-packages.nix @@ -0,0 +1,78 @@ +{ pkgs, ...}: +let + + # bash script to let dbus know about important env variables and + # propagate them to relevent services run at the end of sway config + # see + # https://github.com/emersion/xdg-desktop-portal-wlr/wiki/"It-doesn't-work"-Troubleshooting-Checklist + # note: this is pretty much the same as /etc/sway/config.d/nixos.conf but also restarts + # some user services to make sure they have the correct environment variables + dbus-sway-environment = pkgs.writeTextFile { + name = "dbus-sway-environment"; + destination = "/bin/dbus-sway-environment"; + executable = true; + + text = '' + dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway + systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr + systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr + ''; + }; + + # currently, there is some friction between sway and gtk: + # https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland + # the suggested way to set gtk settings is with gsettings + # for gsettings to work, we need to tell it where the schemas are + # using the XDG_DATA_DIR environment variable + # run at the end of sway config + configure-gtk = pkgs.writeTextFile { + name = "configure-gtk"; + destination = "/bin/configure-gtk"; + executable = true; + text = let + schema = pkgs.gsettings-desktop-schemas; + datadir = "${schema}/share/gsettings-schemas/${schema.name}"; + in '' + export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS + gnome_schema=org.gnome.desktop.interface + gsettings set $gnome_schema gtk-theme 'Dracula' + ''; + }; + +in + +{ + programs.partition-manager.enable = true; + environment.systemPackages = with pkgs; [ + #For root + nushell + bat + helix + wget + unzip + git + wl-clipboard + pciutils + #For hyprland + waybar + #For sway + alacritty # gpu accelerated terminal + dbus-sway-environment + configure-gtk + wayland + waybar + xdg-utils # for opening default programs when clicking links + glib # gsettings + dracula-theme # gtk theme + gnome3.adwaita-icon-theme # default gnome cursors + swaylock + swayidle + grim # screenshot functionality + slurp # screenshot functionality + bemenu # wayland clone of dmenu + mako # notification system developed by swaywm maintainer + wdisplays # tool to configure displays + wofi + (writeShellScriptBin "rofi" "exec -a $0 ${wofi}/bin/wofi $@") #Lets qutebrowser select passwords + ]; +} diff --git a/modules/services.nix b/modules/services.nix deleted file mode 100644 index 336d132..0000000 --- a/modules/services.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ config, pkgs, ... }: -{ - services = { - pipewire = { - enable = true; - alsa.enable = true; - pulse.enable = true; - }; - spotifyd.enable = true; - - #FOR: sway - dbus.enable = true; - - #FROM: configuration.nix - # localtimed.enable = true; - xserver = { - # Enable the X11 windowing system. - enable = true; - - # Enable touchpad support (enabled default in most desktopManager). - libinput.enable = true; - - # Configure keymap in X11 - # layout = "us"; - # xkbOptions = "eurosign:e,caps:escape"; - - # Enable the Plasma 5 Desktop Environment. - desktopManager.plasma5.enable = true; - displayManager = { - sddm.enable = true; - defaultSession = "plasmawayland"; - }; - }; - - # Enable CUPS to print documents. - printing = { - enable = true; - drivers = with pkgs; [ epson-escpr gutenprint ]; - }; - avahi = { - enable = true; - nssmdns = true; - # for a WiFi printer - openFirewall = true; - }; - - # Enable the OpenSSH daemon. - # openssh.enable = true; - }; -} diff --git a/modules/steam.nix b/modules/steam.nix deleted file mode 100644 index 91c5b67..0000000 --- a/modules/steam.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, ... }: { - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - # dedicatedServer.openfirewall = true; - }; -} diff --git a/modules/sway.nix b/modules/sway.nix deleted file mode 100644 index 8d4d664..0000000 --- a/modules/sway.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ config, pkgs, lib, ... }: -{ - environment.systemPackages = with pkgs; [ - ]; - - # xdg-desktop-portal works by exposing a series of D-Bus interfaces - # known as portals under a well-known name - # (org.freedesktop.portal.Desktop) and object path - # (/org/freedesktop/portal/desktop). - # The portal interfaces include APIs for file access, opening URIs, - # printing and others. - xdg.portal = { - enable = true; - wlr.enable = true; - # gtk portal needed to make gtk apps happy - extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - }; - - # enable sway window manager - programs.sway = { - enable = true; - wrapperFeatures.gtk = true; - }; - - # kanshi systemd service - systemd.user.services.kanshi = { - description = "kanshi daemon"; - serviceConfig = { - Type = "simple"; - ExecStart = ''${pkgs.kanshi}/bin/kanshi -c kanshi_config_file''; - }; - }; - - security.pam.services.swaylock.text = '' - # PAM configuration file for the swaylock screen locker. By default, it includes - # the 'login' configuration file (see /etc/pam.d/login) - auth include login - ''; -} - diff --git a/modules/system-packages.nix b/modules/system-packages.nix deleted file mode 100644 index 1ffa540..0000000 --- a/modules/system-packages.nix +++ /dev/null @@ -1,78 +0,0 @@ -{ pkgs, ...}: -let - - # bash script to let dbus know about important env variables and - # propagate them to relevent services run at the end of sway config - # see - # https://github.com/emersion/xdg-desktop-portal-wlr/wiki/"It-doesn't-work"-Troubleshooting-Checklist - # note: this is pretty much the same as /etc/sway/config.d/nixos.conf but also restarts - # some user services to make sure they have the correct environment variables - dbus-sway-environment = pkgs.writeTextFile { - name = "dbus-sway-environment"; - destination = "/bin/dbus-sway-environment"; - executable = true; - - text = '' - dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway - systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr - systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr - ''; - }; - - # currently, there is some friction between sway and gtk: - # https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland - # the suggested way to set gtk settings is with gsettings - # for gsettings to work, we need to tell it where the schemas are - # using the XDG_DATA_DIR environment variable - # run at the end of sway config - configure-gtk = pkgs.writeTextFile { - name = "configure-gtk"; - destination = "/bin/configure-gtk"; - executable = true; - text = let - schema = pkgs.gsettings-desktop-schemas; - datadir = "${schema}/share/gsettings-schemas/${schema.name}"; - in '' - export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS - gnome_schema=org.gnome.desktop.interface - gsettings set $gnome_schema gtk-theme 'Dracula' - ''; - }; - -in - -{ - programs.partition-manager.enable = true; - environment.systemPackages = with pkgs; [ - #For root - nushell - bat - helix - wget - unzip - git - wl-clipboard - pciutils - #For hyprland - waybar - #For sway - alacritty # gpu accelerated terminal - dbus-sway-environment - configure-gtk - wayland - waybar - xdg-utils # for opening default programs when clicking links - glib # gsettings - dracula-theme # gtk theme - gnome3.adwaita-icon-theme # default gnome cursors - swaylock - swayidle - grim # screenshot functionality - slurp # screenshot functionality - bemenu # wayland clone of dmenu - mako # notification system developed by swaywm maintainer - wdisplays # tool to configure displays - wofi - (writeShellScriptBin "rofi" "exec -a $0 ${wofi}/bin/wofi $@") #Lets qutebrowser select passwords - ]; -} -- cgit v1.2.3