separa configuración en plataformas
This commit is contained in:
parent
1433a1f96b
commit
11b9855244
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
result
|
3
base/platforms/posixlycorrect.nix
Normal file
3
base/platforms/posixlycorrect.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
|
||||
}
|
41
flake.nix
41
flake.nix
|
@ -19,19 +19,50 @@
|
|||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
in
|
||||
{
|
||||
nixosConfigurations.posixlycorrect = nixpkgs.lib.nixosSystem {
|
||||
|
||||
inherit (pkgs) lib;
|
||||
|
||||
base = platform: {
|
||||
name = platform;
|
||||
value = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
|
||||
modules = [ ( import ./base ) ];
|
||||
};
|
||||
};
|
||||
|
||||
homeConfigurations."fabian@posixlycorrect" = home-manager.lib.homeManagerConfiguration {
|
||||
home = platform: {
|
||||
name = "fabian@${platform}";
|
||||
value = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
|
||||
modules = [ (import ./home {inherit self nixpkgs unstable hm-isolation; }) ];
|
||||
modules = [
|
||||
(import ./home {
|
||||
inherit self nixpkgs unstable hm-isolation;
|
||||
})
|
||||
|
||||
./home/platforms/${platform}.nix
|
||||
|
||||
{
|
||||
config.local = { inherit platform; };
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
platforms = domain:
|
||||
map
|
||||
(lib.removeSuffix ".nix")
|
||||
(lib.attrNames (builtins.readDir ./${domain}/platforms));
|
||||
|
||||
configs = domain: builder:
|
||||
lib.listToAttrs
|
||||
(map builder (platforms domain));
|
||||
in
|
||||
{
|
||||
|
||||
nixosConfigurations = configs "base" base;
|
||||
homeConfigurations = configs "home" home;
|
||||
|
||||
packages."${system}" = packages pkgs;
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
{ nixpkgs, unstable, self, hm-isolation }:
|
||||
{ self, nixpkgs, unstable, hm-isolation }:
|
||||
{ config, pkgs, lib, ... } :
|
||||
with lib;
|
||||
{
|
||||
imports = [
|
||||
(hm-isolation.homeManagerModule)
|
||||
./allowUnfreeWhitelist.nix
|
||||
./gui
|
||||
./isolation.nix
|
||||
./local.nix
|
||||
./path.nix
|
||||
./systemd
|
||||
./allowUnfreeWhitelist.nix
|
||||
];
|
||||
|
||||
nixpkgs.overlays = [ self.overlay ];
|
||||
|
|
|
@ -87,14 +87,13 @@ with lib;
|
|||
|
||||
workspaceOutputAssign = [
|
||||
{
|
||||
output = "DisplayPort-0";
|
||||
output = config.local.display."0";
|
||||
workspace = "1";
|
||||
}
|
||||
{
|
||||
output = "DisplayPort-1";
|
||||
] ++ optional (config.local.display."1" != null) {
|
||||
output = config.local.display."1";
|
||||
workspace = "10";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
bars = [ ];
|
||||
};
|
||||
|
|
19
home/local.nix
Normal file
19
home/local.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ config, lib, ... } :
|
||||
with lib;
|
||||
{
|
||||
options.local = with types; {
|
||||
platform = mkOption {
|
||||
type = str;
|
||||
};
|
||||
|
||||
display = {
|
||||
"0" = mkOption {
|
||||
type = str;
|
||||
};
|
||||
|
||||
"1" = mkOption {
|
||||
type = nullOr str;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
6
home/platforms/posixlycorrect.nix
Normal file
6
home/platforms/posixlycorrect.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
config.local.display = {
|
||||
"0" = "DisplayPort-0";
|
||||
"1" = "DisplayPort-1";
|
||||
};
|
||||
}
|
6
home/platforms/thinkpad.nix
Normal file
6
home/platforms/thinkpad.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
config.local.display = {
|
||||
"0" = "eDP-1";
|
||||
"1" = null;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue