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

View file

@ -78,7 +78,7 @@
"${primeMod}+${secMod}+Ctrl+r" = ''exec rofiscripts --resolutions'';
# 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
"${primeMod}+Return" = ''exec foot'';

View file

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

View file

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

View file

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