config-manager: Remove system option in favor of pkgs.system
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
To install it
|
To install it
|
||||||
1. first add the module to the nixOS system connfiguration
|
1. first add the module to the nixOS system connfiguration
|
||||||
2. set `config-manager.flakePath = <path to this flake>`
|
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>`
|
4. run `nixos-rebuild switch --flake .#<configuration>`
|
||||||
after that `cm` will be available on `$PATH`.
|
after that `cm` will be available on `$PATH`.
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,14 @@
|
|||||||
let
|
let
|
||||||
flakePath = config.config-manager.flakePath;
|
flakePath = config.config-manager.flakePath;
|
||||||
nixosConfiguration = config.config-manager.nixosConfiguration;
|
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 =
|
config-manager =
|
||||||
if flakePath == "" then
|
if flakePath == "" then
|
||||||
throw "'config-manager.flakePath' cannot be empty"
|
throw "'config-manager.flakePath' cannot be empty"
|
||||||
else if nixosConfiguration == "" then
|
else if nixosConfiguration == "" then
|
||||||
throw "'config-manager.nixosConfiguration' cannot be empty"
|
throw "'config-manager.nixosConfiguration' cannot be empty"
|
||||||
else if system == "" then
|
|
||||||
throw "'config-manager.system' cannot be empty"
|
|
||||||
else
|
else
|
||||||
pkgs.writeShellScriptBin "cm" ''
|
pkgs.writeShellScriptBin "cm" ''
|
||||||
help() {
|
help() {
|
||||||
@@ -60,12 +57,6 @@ in
|
|||||||
default = config.networking.hostName;
|
default = config.networking.hostName;
|
||||||
description = "what nixosConfiguration to use";
|
description = "what nixosConfiguration to use";
|
||||||
};
|
};
|
||||||
|
|
||||||
system = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "";
|
|
||||||
description = "what system the host is (x86_64-linux, aarch64-linux)";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,6 @@
|
|||||||
|
|
||||||
config-manager = {
|
config-manager = {
|
||||||
flakePath = "/home/alex/config";
|
flakePath = "/home/alex/config";
|
||||||
system=pkgs.system;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mod = {
|
mod = {
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
{ inputs, config, ... }:
|
{ inputs, pkgs, ... }:
|
||||||
let
|
|
||||||
system = config.config-manager.system;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
age = {
|
age = {
|
||||||
identityPaths = [
|
identityPaths = [
|
||||||
@@ -11,6 +8,6 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
inputs.agenix.packages."${system}".default
|
inputs.agenix.packages."${pkgs.system}".default
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
{ inputs, pkgs, lib, config, ...}:
|
{ inputs, pkgs, lib, config, ...}:
|
||||||
let
|
let
|
||||||
system = config.config-manager.system;
|
|
||||||
|
|
||||||
hyprlandEnabled = config.mod.hyprland.enable;
|
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";
|
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";
|
screen = "${pkgs.libnotify}/bin/notify-send 'ps: selected screen' &&${grimblast}/bin/grimblast copy output";
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -76,7 +76,6 @@
|
|||||||
|
|
||||||
config-manager = {
|
config-manager = {
|
||||||
flakePath = "/home/alex/config";
|
flakePath = "/home/alex/config";
|
||||||
system = pkgs.system;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mod = {
|
mod = {
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
{ inputs, config, ... }:
|
{ inputs, pkgs, ... }:
|
||||||
let
|
|
||||||
system = config.config-manager.system;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
age = {
|
age = {
|
||||||
identityPaths = [ "/etc/ssh/sombrero" ];
|
identityPaths = [ "/etc/ssh/sombrero" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
inputs.agenix.packages."${system}".default
|
inputs.agenix.packages."${pkgs.system}".default
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user