From f9c6777f3d4f3c4a4e837947db96babc9fe16a42 Mon Sep 17 00:00:00 2001 From: Natalie Marks Date: Thu, 22 Feb 2024 15:27:47 -0800 Subject: [PATCH] bleh bleh bleh bleh --- flake.nix | 131 +++++++++++++++++++++++++++++++++++++++------------ oldflake.nix | 47 ++++++++++++++++++ 2 files changed, 148 insertions(+), 30 deletions(-) create mode 100644 oldflake.nix diff --git a/flake.nix b/flake.nix index 4e007bf..741e4ce 100644 --- a/flake.nix +++ b/flake.nix @@ -1,45 +1,116 @@ { - description = "My first flake!"; - + description = "New Modular flake!"; inputs = { - nixpkgs.url = "nixpkgs/nixos-23.11"; - home-manager = { - url = "github:nix-community/home-manager/release-23.11"; - inputs.nixpkgs.follows = "nixpkgs"; + nixpkgs.url = "nixpkgs/nixos-unstable"; + nixpkgs-stable.url = "nixpkgs/nixos-23.11"; + + home-manager.url = "github:nix-community/home-manager/master"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + + stylix.url = "github:danth/stylix"; + blocklist-hosts = { + url = "github:StevenBlack/hosts"; + #flake = false; + }; + hyprland.url = "github:hyprwm/Hyprland"; + hyprland-plugins = { + url = "github:hyprwm/hyprland-plugins"; + inputs.hyprland.follows = "hyprland"; + #flake = false; }; - - # hyprland.url = "github:hyprwm/Hyprland"; - # hyprland-plugins = { - # url = "github:hyprwm/hyprland-plugins"; - # inputs.hyprland.follows = "hyprland"; - # }; - # use the following for unstable: - # nixpkgs.url = "nixpkgs/nixos-unstable"; - - # or any branch you want: - # nixpkgs.url = "nixpkgs/{BRANCH-NAME}" }; - outputs = { self, - home-manager, nixpkgs, + nixpkgs-stable, + home-manager, + stylix, + blocklist-hosts, + hyprland-plugins, ... - }: let - system = "x86_64-linux"; - lib = nixpkgs.lib; - pkgs = nixpkgs.legacyPackages.${system}; - in { - nixosConfigurations = { - nmarks = lib.nixosSystem { - inherit system; - modules = [./configuration.nix]; - }; + } @ inputs: let + systemSettings = { + system = "x86_64-linux"; # system arch + hostname = "nixos"; # hostname + #profile = "personal"; # select a profile defined from my profiles directory + timezone = "America/Los_Angeles"; # select timezone + locale = "en_US.UTF-8"; # select locale }; + userSettings = rec { + username = "nmarks"; # username + name = "Nmarks"; # name/identifier + email = "nmarks413@gmail.com"; # email (used for certain configurations) + dotfilesDir = "~/.dotfiles"; # absolute path of the local repo + #theme = "uwunicorn-yt"; # selcted theme from my themes directory (./themes/) + wm = "hyprland"; # Selected window manager or desktop environment; must select one in both ./user/wm/ and ./system/wm/ + # window manager type (hyprland or x11) translator + wmType = + if (wm == "hyprland") + then "wayland" + else "x11"; + browser = "firefox"; # Default browser; must select one from ./user/app/browser/ + term = "kitty"; # Default terminal command; + font = ""; # Selected font + fontPkg = pkgs.intel-one-mono; # Font package + editor = "nvim"; # Default editor; + # editor spawning translator + # generates a command that can be used to spawn editor inside a gui + # EDITOR and TERM session variables must be set in home.nix or other module + # I set the session variable SPAWNEDITOR to this in my home.nix for convenience + spawnEditor = + if (editor == "emacsclient") + then "emacsclient -c -a 'emacs'" + else + ( + if ((editor == "vim") || (editor == "nvim") || (editor == "nano")) + then "exec " + term + " -e " + editor + else editor + ); + }; + pkgs = import nixpkgs { + system = systemSettings.system; + config = { + allowUnfree = true; + allowUnfreePredicate = _: true; + }; + overlays = []; + }; + + pkgs-stable = import nixpkgs-stable { + system = systemSettings.system; + config = { + allowUnfree = true; + allowUnfreePredicate = _: true; + }; + overlays = []; + }; + + lib = nixpkgs.lib; + in { homeConfigurations = { - nmarks = home-manager.lib.homeManagerConfiguration { + user = home-manager.lib.homeManagerConfiguration { inherit pkgs; modules = [./home.nix]; + extraSpecialArgs = { + inherit pkgs-stable; + inherit systemSettings; + inherit userSettings; + inherit stylix; + inherit hyprland-plugins; + }; + }; + }; + nixosConfigurations = { + system = lib.nixosSystem { + system = systemSettings.system; + modules = [./configuration.nix]; + specialArgs = { + inherit pkgs-stable; + inherit systemSettings; + inherit userSettings; + inherit stylix; + inherit blocklist-hosts; + }; }; }; }; diff --git a/oldflake.nix b/oldflake.nix new file mode 100644 index 0000000..e5cf756 --- /dev/null +++ b/oldflake.nix @@ -0,0 +1,47 @@ +{ + description = "My first flake!"; + + inputs = { + nixpkgs.url = "nixpkgs/nixos-23.11"; + home-manager = { + url = "github:nix-community/home-manager/release-23.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=<0.2.0>"; + + # hyprland.url = "github:hyprwm/Hyprland"; + # hyprland-plugins = { + # url = "github:hyprwm/hyprland-plugins"; + # inputs.hyprland.follows = "hyprland"; + # }; + # use the following for unstable: + # nixpkgs.url = "nixpkgs/nixos-unstable"; + + # or any branch you want: + # nixpkgs.url = "nixpkgs/{BRANCH-NAME}" + }; + + outputs = { + self, + home-manager, + nixpkgs, + ... + }: let + system = "x86_64-linux"; + lib = nixpkgs.lib; + pkgs = nixpkgs.legacyPackages.${system}; + in { + nixosConfigurations = { + nmarks = lib.nixosSystem { + inherit system; + modules = [./configuration.nix]; + }; + }; + homeConfigurations = { + nmarks = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + modules = [./home.nix]; + }; + }; + }; +}