Compare commits
No commits in common. "750f2efaa73b510d9f0bfc45d844bfb11dd59377" and "e9edf5ad55bd77ba42fd46e7212c1ed6540a1070" have entirely different histories.
750f2efaa7
...
e9edf5ad55
7 changed files with 96 additions and 144 deletions
|
@ -28,10 +28,7 @@ let
|
|||
name: value:
|
||||
if class == "nixos" then
|
||||
nixosSystem {
|
||||
specialArgs = {
|
||||
inherit (config.flake) self;
|
||||
hostName = name;
|
||||
};
|
||||
specialArgs.hostName = name;
|
||||
modules = [
|
||||
cfg.modules.nixos.default
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
|
@ -41,15 +38,11 @@ let
|
|||
}
|
||||
else if class == "darwin" then
|
||||
darwinSystem {
|
||||
specialArgs = {
|
||||
inherit (config.flake) self;
|
||||
hostName = name;
|
||||
};
|
||||
specialArgs = { inherit (config.flake) self; };
|
||||
modules = [
|
||||
cfg.modules.darwin.default
|
||||
inputs.home-manager.darwinModules.home-manager
|
||||
{ home-manager = globalCfg name value; }
|
||||
(value.extraCfg or { })
|
||||
] ++ optional value.graphical cfg.modules.darwin.graphical;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
enableTreesitter = true;
|
||||
bash.enable = true;
|
||||
clang.enable = true;
|
||||
# broken on macos
|
||||
# csharp.enable = true;
|
||||
csharp.enable = true;
|
||||
css.enable = true;
|
||||
go.enable = true;
|
||||
html.enable = true;
|
||||
|
|
|
@ -7,18 +7,8 @@
|
|||
shell = "fish";
|
||||
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILdsZyY3gu8IGB8MzMnLdh+ClDxQQ2RYG9rkeetIKq8n rafiq";
|
||||
};
|
||||
hosts = {
|
||||
darwin = {
|
||||
venus = {
|
||||
graphical = true;
|
||||
machine.platform = "intel";
|
||||
};
|
||||
hephaestus = {
|
||||
graphical = true;
|
||||
machine.platform = "apple-silicon";
|
||||
};
|
||||
};
|
||||
nixos = {
|
||||
hosts.darwin.venus.graphical = true;
|
||||
hosts.nixos = {
|
||||
nemesis = {
|
||||
graphical = true;
|
||||
machine = {
|
||||
|
@ -100,5 +90,4 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5,8 +5,7 @@ let
|
|||
inherit (lib.attrsets) mapAttrs';
|
||||
in
|
||||
{
|
||||
flake.modules = {
|
||||
nixos.default =
|
||||
flake.modules.nixos.default =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs = mapAttrs' (name: value: {
|
||||
|
@ -15,21 +14,10 @@ in
|
|||
}) cfg.manifest.users;
|
||||
users.users = forAllUsers' (_: value: { shell = pkgs.${value.shell}; });
|
||||
};
|
||||
darwin.default =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs = mapAttrs' (name: value: {
|
||||
name = value.shell;
|
||||
value.enable = true;
|
||||
}) cfg.manifest.users;
|
||||
users.users = forAllUsers' (_: value: { shell = pkgs.${value.shell}; });
|
||||
environment.shells = [ pkgs.fish ];
|
||||
};
|
||||
homeManager.default =
|
||||
flake.modules.homeManager.default =
|
||||
{ config, ... }:
|
||||
{
|
||||
programs.${cfg.manifest.users.${config.home.username}.shell}.enable = true;
|
||||
home.shell.enableShellIntegration = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -12,13 +12,9 @@
|
|||
nixpkgs.hostPlatform = "${arch}-linux";
|
||||
};
|
||||
|
||||
flake.modules.darwin.default =
|
||||
{ hostName, ... }:
|
||||
let
|
||||
inherit (config.flake.manifest.hosts.darwin.${hostName}.machine) platform;
|
||||
arch = if platform == "intel" then "x86_64" else "aarch64";
|
||||
in
|
||||
{
|
||||
nixpkgs.hostPlatform = "${arch}-darwin";
|
||||
flake.modules.darwin.default.nixpkgs = {
|
||||
hostPlatform = "x86_64-darwin";
|
||||
# config.allowUnsupportedSystem = true;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -14,12 +14,7 @@ in
|
|||
persistDirs = [ "/var/lib/tailscale" ];
|
||||
sops.secrets."tailscale/client-secret".sopsFile = secrets + "/tailscale.yaml";
|
||||
};
|
||||
flake.modules.darwin.default =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
package = pkgs.tailscale.overrideAttrs { doCheck = false; };
|
||||
};
|
||||
flake.modules.darwin.default = {
|
||||
services.tailscale.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
{ config, lib, ... }:
|
||||
{ config, ... }:
|
||||
let
|
||||
cfg = config.flake;
|
||||
inherit (cfg.lib.modules) userListToAttrs forAllUsers';
|
||||
inherit (lib.lists) findFirstIndex;
|
||||
inherit (builtins) attrNames;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.default =
|
||||
|
@ -36,13 +34,7 @@ in
|
|||
flake.modules.darwin.default =
|
||||
{ config, ... }:
|
||||
{
|
||||
users.knownUsers = attrNames cfg.manifest.users;
|
||||
users.users = forAllUsers' (
|
||||
name: _: {
|
||||
home = "/Users/${name}";
|
||||
uid = 501 + (findFirstIndex (x: x == name) null (attrNames cfg.manifest.users));
|
||||
}
|
||||
);
|
||||
users.users = forAllUsers' (name: _: { home = "/Users/${name}"; });
|
||||
home-manager.users = forAllUsers' (
|
||||
name: _: {
|
||||
home.username = name;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue