config-manager: Remove system option in favor of pkgs.system

This commit is contained in:
Alexander Heldt
2023-11-01 16:05:00 +01:00
parent 89cd417d12
commit 39fb7e868f
7 changed files with 6 additions and 26 deletions

View File

@@ -4,7 +4,6 @@
To install it
1. first add the module to the nixOS system connfiguration
2. set `config-manager.flakePath = <path to this flake>`
3. set `config-manager.system = <system type for the machine>`
4. run `nixos-rebuild switch --flake .#<configuration>`
after that `cm` will be available on `$PATH`.

View File

@@ -2,17 +2,14 @@
let
flakePath = config.config-manager.flakePath;
nixosConfiguration = config.config-manager.nixosConfiguration;
system = config.config-manager.system;
nh = inputs.nh.packages."${system}".default;
nh = inputs.nh.packages."${pkgs.system}".default;
config-manager =
if flakePath == "" then
throw "'config-manager.flakePath' cannot be empty"
else if nixosConfiguration == "" then
throw "'config-manager.nixosConfiguration' cannot be empty"
else if system == "" then
throw "'config-manager.system' cannot be empty"
else
pkgs.writeShellScriptBin "cm" ''
help() {
@@ -60,12 +57,6 @@ in
default = config.networking.hostName;
description = "what nixosConfiguration to use";
};
system = lib.mkOption {
type = lib.types.str;
default = "";
description = "what system the host is (x86_64-linux, aarch64-linux)";
};
};
};

View File

@@ -71,7 +71,6 @@
config-manager = {
flakePath = "/home/alex/config";
system=pkgs.system;
};
mod = {

View File

@@ -1,7 +1,4 @@
{ inputs, config, ... }:
let
system = config.config-manager.system;
in
{ inputs, pkgs, ... }:
{
age = {
identityPaths = [
@@ -11,6 +8,6 @@ in
};
environment.systemPackages = [
inputs.agenix.packages."${system}".default
inputs.agenix.packages."${pkgs.system}".default
];
}

View File

@@ -1,10 +1,8 @@
{ inputs, pkgs, lib, config, ...}:
let
system = config.config-manager.system;
hyprlandEnabled = config.mod.hyprland.enable;
grimblast = inputs.hyprland-contrib.packages.${system}.grimblast;
grimblast = inputs.hyprland-contrib.packages.${pkgs.system}.grimblast;
area = "${pkgs.libnotify}/bin/notify-send 'ps: selected area' && ${grimblast}/bin/grimblast copy area";
screen = "${pkgs.libnotify}/bin/notify-send 'ps: selected screen' &&${grimblast}/bin/grimblast copy output";
in

View File

@@ -76,7 +76,6 @@
config-manager = {
flakePath = "/home/alex/config";
system = pkgs.system;
};
mod = {

View File

@@ -1,13 +1,10 @@
{ inputs, config, ... }:
let
system = config.config-manager.system;
in
{ inputs, pkgs, ... }:
{
age = {
identityPaths = [ "/etc/ssh/sombrero" ];
};
environment.systemPackages = [
inputs.agenix.packages."${system}".default
inputs.agenix.packages."${pkgs.system}".default
];
}