| ... | ... | @@ -1,45 +1,116 @@ |
| 1 | 1 | { |
| 2 | | description = "My first flake!"; |
| 3 | | |
| 2 | description = "New Modular flake!"; |
| 4 | 3 | inputs = { |
| 5 | | nixpkgs.url = "nixpkgs/nixos-23.11"; |
| 6 | | home-manager = { |
| 7 | | url = "github:nix-community/home-manager/release-23.11"; |
| 8 | | inputs.nixpkgs.follows = "nixpkgs"; |
| 9 | | }; |
| 4 | nixpkgs.url = "nixpkgs/nixos-unstable"; |
| 5 | nixpkgs-stable.url = "nixpkgs/nixos-23.11"; |
| 10 | 6 | |
| 11 | | # hyprland.url = "github:hyprwm/Hyprland"; |
| 12 | | # hyprland-plugins = { |
| 13 | | # url = "github:hyprwm/hyprland-plugins"; |
| 14 | | # inputs.hyprland.follows = "hyprland"; |
| 15 | | # }; |
| 16 | | # use the following for unstable: |
| 17 | | # nixpkgs.url = "nixpkgs/nixos-unstable"; |
| 7 | home-manager.url = "github:nix-community/home-manager/master"; |
| 8 | home-manager.inputs.nixpkgs.follows = "nixpkgs"; |
| 18 | 9 | |
| 19 | | # or any branch you want: |
| 20 | | # nixpkgs.url = "nixpkgs/{BRANCH-NAME}" |
| 10 | stylix.url = "github:danth/stylix"; |
| 11 | blocklist-hosts = { |
| 12 | url = "github:StevenBlack/hosts"; |
| 13 | #flake = false; |
| 14 | }; |
| 15 | hyprland.url = "github:hyprwm/Hyprland"; |
| 16 | hyprland-plugins = { |
| 17 | url = "github:hyprwm/hyprland-plugins"; |
| 18 | inputs.hyprland.follows = "hyprland"; |
| 19 | #flake = false; |
| 20 | }; |
| 21 | 21 | }; |
| 22 | | |
| 23 | 22 | outputs = { |
| 24 | 23 | self, |
| 25 | | home-manager, |
| 26 | 24 | nixpkgs, |
| 25 | nixpkgs-stable, |
| 26 | home-manager, |
| 27 | stylix, |
| 28 | blocklist-hosts, |
| 29 | hyprland-plugins, |
| 27 | 30 | ... |
| 28 | | }: let |
| 29 | | system = "x86_64-linux"; |
| 30 | | lib = nixpkgs.lib; |
| 31 | | pkgs = nixpkgs.legacyPackages.${system}; |
| 32 | | in { |
| 33 | | nixosConfigurations = { |
| 34 | | nmarks = lib.nixosSystem { |
| 35 | | inherit system; |
| 36 | | modules = [./configuration.nix]; |
| 31 | } @ inputs: let |
| 32 | systemSettings = { |
| 33 | system = "x86_64-linux"; # system arch |
| 34 | hostname = "nixos"; # hostname |
| 35 | #profile = "personal"; # select a profile defined from my profiles directory |
| 36 | timezone = "America/Los_Angeles"; # select timezone |
| 37 | locale = "en_US.UTF-8"; # select locale |
| 38 | }; |
| 39 | userSettings = rec { |
| 40 | username = "nmarks"; # username |
| 41 | name = "Nmarks"; # name/identifier |
| 42 | email = "nmarks413@gmail.com"; # email (used for certain configurations) |
| 43 | dotfilesDir = "~/.dotfiles"; # absolute path of the local repo |
| 44 | #theme = "uwunicorn-yt"; # selcted theme from my themes directory (./themes/) |
| 45 | wm = "hyprland"; # Selected window manager or desktop environment; must select one in both ./user/wm/ and ./system/wm/ |
| 46 | # window manager type (hyprland or x11) translator |
| 47 | wmType = |
| 48 | if (wm == "hyprland") |
| 49 | then "wayland" |
| 50 | else "x11"; |
| 51 | browser = "firefox"; # Default browser; must select one from ./user/app/browser/ |
| 52 | term = "kitty"; # Default terminal command; |
| 53 | font = ""; # Selected font |
| 54 | fontPkg = pkgs.intel-one-mono; # Font package |
| 55 | editor = "nvim"; # Default editor; |
| 56 | # editor spawning translator |
| 57 | # generates a command that can be used to spawn editor inside a gui |
| 58 | # EDITOR and TERM session variables must be set in home.nix or other module |
| 59 | # I set the session variable SPAWNEDITOR to this in my home.nix for convenience |
| 60 | spawnEditor = |
| 61 | if (editor == "emacsclient") |
| 62 | then "emacsclient -c -a 'emacs'" |
| 63 | else |
| 64 | ( |
| 65 | if ((editor == "vim") || (editor == "nvim") || (editor == "nano")) |
| 66 | then "exec " + term + " -e " + editor |
| 67 | else editor |
| 68 | ); |
| 69 | }; |
| 70 | pkgs = import nixpkgs { |
| 71 | system = systemSettings.system; |
| 72 | config = { |
| 73 | allowUnfree = true; |
| 74 | allowUnfreePredicate = _: true; |
| 75 | }; |
| 76 | overlays = []; |
| 77 | }; |
| 78 | |
| 79 | pkgs-stable = import nixpkgs-stable { |
| 80 | system = systemSettings.system; |
| 81 | config = { |
| 82 | allowUnfree = true; |
| 83 | allowUnfreePredicate = _: true; |
| 37 | 84 | }; |
| 85 | overlays = []; |
| 38 | 86 | }; |
| 87 | |
| 88 | lib = nixpkgs.lib; |
| 89 | in { |
| 39 | 90 | homeConfigurations = { |
| 40 | | nmarks = home-manager.lib.homeManagerConfiguration { |
| 91 | user = home-manager.lib.homeManagerConfiguration { |
| 41 | 92 | inherit pkgs; |
| 42 | 93 | modules = [./home.nix]; |
| 94 | extraSpecialArgs = { |
| 95 | inherit pkgs-stable; |
| 96 | inherit systemSettings; |
| 97 | inherit userSettings; |
| 98 | inherit stylix; |
| 99 | inherit hyprland-plugins; |
| 100 | }; |
| 101 | }; |
| 102 | }; |
| 103 | nixosConfigurations = { |
| 104 | system = lib.nixosSystem { |
| 105 | system = systemSettings.system; |
| 106 | modules = [./configuration.nix]; |
| 107 | specialArgs = { |
| 108 | inherit pkgs-stable; |
| 109 | inherit systemSettings; |
| 110 | inherit userSettings; |
| 111 | inherit stylix; |
| 112 | inherit blocklist-hosts; |
| 113 | }; |
| 43 | 114 | }; |
| 44 | 115 | }; |
| 45 | 116 | }; |