Going to be changing the way I do variables I think, remove the cmd var

This commit is contained in:
Jimbo 2024-10-13 02:23:51 -04:00
parent cd92b28dc6
commit fa3890b814
5 changed files with 51 additions and 76 deletions

View file

@ -1,4 +1,6 @@
{ {
description = "Jimbo's systems as a flake";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
unstable.url = "github:nixos/nixpkgs/nixos-unstable"; unstable.url = "github:nixos/nixpkgs/nixos-unstable";
@ -33,17 +35,18 @@
home-manager, home-manager,
... ...
}@inputs: let }@inputs: let
inherit (self) outputs; mkNixos = modules: nixpkgs.lib.nixosSystem {
forAllSystems = nixpkgs.lib.genAttrs [ inherit modules;
"aarch64-linux" specialArgs = { inherit (self) inputs outputs; };
"x86_64-linux" };
];
in rec {
packages = forAllSystems (system: import ./packages nixpkgs.legacyPackages.${system});
mkHome = modules: pkgs: home-manager.lib.homeManagerConfiguration {
inherit modules pkgs;
extraSpecialArgs = { inherit (self) inputs outputs; };
};
in {
# Variables defined so they can be accessed globally # Variables defined so they can be accessed globally
secrets = import ./variables/secrets; secrets = import ./variables/secrets;
cmd = import ./variables/cmd;
displays = import ./variables/displays; displays = import ./variables/displays;
ips = import ./variables/ips; ips = import ./variables/ips;
look = import ./variables/look; look = import ./variables/look;
@ -51,62 +54,40 @@
# NixOS config entrypoint, use 'nixos-rebuild --flake .#your-hostname' # NixOS config entrypoint, use 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = { nixosConfigurations = {
firefly = nixpkgs.lib.nixosSystem { firefly = mkNixos [
specialArgs = {inherit inputs outputs;};
modules = [
./hosts/firefly/system ./hosts/firefly/system
lanzaboote.nixosModules.lanzaboote lanzaboote.nixosModules.lanzaboote
]; ];
}; cyberspark = mkNixos [
cyberspark = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./system/hosts/JimServer/configuration.nix ./system/hosts/JimServer/configuration.nix
mailserver.nixosModule mailserver.nixosModule
]; ];
}; shuttleworth = mkNixos [
shuttleworth = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./system/hosts/JimPine/configuration.nix ./system/hosts/JimPine/configuration.nix
hardware.nixosModules.pine64-pinebook-pro hardware.nixosModules.pine64-pinebook-pro
]; ];
}; };
};
# Home-manager configuration, use 'home-manager --flake .#your-username@your-hostname' # Home-manager configuration, use 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = { homeConfigurations = {
"jimbo@firefly" = home-manager.lib.homeManagerConfiguration { "jimbo@firefly" = mkHome [
pkgs = nixpkgs.legacyPackages.x86_64-linux; ./hosts/firefly/home
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home/hosts/JimDesktop/home.nix
nur.nixosModules.nur nur.nixosModules.nur
]; ] nixpkgs.legacyPackages.x86_64-linux;
};
"jimbo@cyberspark" = home-manager.lib.homeManagerConfiguration { "jimbo@cyberspark" = mkHome [
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home/hosts/JimServer/home.nix ./home/hosts/JimServer/home.nix
]; ] nixpkgs.legacyPackages.x86_64-linux;
};
"jimbo@shuttleworth" = home-manager.lib.homeManagerConfiguration { "jimbo@shuttleworth" = mkHome [
pkgs = nixpkgs.legacyPackages.aarch64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home/hosts/JimPine/home.nix ./home/hosts/JimPine/home.nix
nur.nixosModules.nur nur.nixosModules.nur
]; ] nixpkgs.legacyPackages.aarch64-linux;
};
# Derivation for ssh envrionments on other people's servers # Profile for ssh envrionments on different non-root systems
"jimbo@JimTerminal" = home-manager.lib.homeManagerConfiguration { "jimbo@terminal" = mkHome [
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home/hosts/JimTerminal/home.nix ./home/hosts/JimTerminal/home.nix
]; ] nixpkgs.legacyPackages.x86_64-linux;
};
}; };
}; };
} }

View file

@ -78,7 +78,7 @@
"${primeMod}+${secMod}+Ctrl+r" = ''exec rofiscripts --resolutions''; "${primeMod}+${secMod}+Ctrl+r" = ''exec rofiscripts --resolutions'';
# Open NixOS configuration files # Open NixOS configuration files
"${primeMod}+F12" = ''exec foot ${outputs.cmd.nixcfg} | ${sendNotif} "Nix Config"''; "${primeMod}+F12" = ''exec foot ranger /etc/nixos | ${sendNotif} "Nix Config"'';
# Terminal, rofi, clipmenu, media script, power menu, show/hide waybar # Terminal, rofi, clipmenu, media script, power menu, show/hide waybar
"${primeMod}+Return" = ''exec foot''; "${primeMod}+Return" = ''exec foot'';

View file

@ -1,4 +1,4 @@
{ pkgs, config, outputs, ... }: { pkgs, config, ... }:
{ {
programs.zsh = { programs.zsh = {
enable = true; enable = true;
@ -11,14 +11,13 @@
}; };
shellAliases = { shellAliases = {
# NixOS aliases # NixOS aliases
nixcfg = "${outputs.cmd.nixcfg}"; nixclean = "doas nix-store --gc; nix-collect-garbage -d";
nixclean = "${outputs.cmd.auth} nix-store --gc; nix-collect-garbage -d"; nixpurge = "doas nix-collect-garbage --delete-old";
nixpurge = "${outputs.cmd.auth} nix-collect-garbage --delete-old"; nixoptimize = "doas nix store optimise";
nixoptimize = "${outputs.cmd.auth} nix store optimise";
# Flake commands # Flake commands
flakedate = "${outputs.cmd.auth} nix flake update /etc/nixos"; flakedate = "doas nix flake update /etc/nixos";
sysswitch = "${outputs.cmd.auth} nixos-rebuild switch --flake /etc/nixos"; sysswitch = "doas nixos-rebuild switch --flake /etc/nixos";
homeswitch = "home-manager switch --flake /etc/nixos"; homeswitch = "home-manager switch --flake /etc/nixos";
nixswitch = "sysswitch; homeswitch"; nixswitch = "sysswitch; homeswitch";
nixdate = "flakedate && sysswitch; homeswitch"; nixdate = "flakedate && sysswitch; homeswitch";

View file

@ -1,4 +1,4 @@
{ outputs, inputs, ... }: { inputs, ... }:
{ {
nixpkgs.overlays = [ nixpkgs.overlays = [
inputs.blender-bin.overlays.default inputs.blender-bin.overlays.default

View file

@ -1,5 +0,0 @@
{ ... }:
{
auth = "doas";
nixcfg = "ranger /etc/nixos";
}