Skip to content
Merged

Dev #22

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@
# Build darwin flake using:
# $ darwin-rebuild build --flake .#defiant
darwinConfigurations = {
defiant = lib.darwinSystem {
system = "aarch64-darwin";
modules = [./hosts/defiant];
specialArgs = {
inherit flake inputs;
system = "aarch64-darwin";
pkgs = lib.refnode.pkgsFor.aarch64-darwin;
};
};
defiant = import ./hosts/defiant {inherit lib flake inputs;};
};

nixosConfigurations = {};
Expand Down
24 changes: 23 additions & 1 deletion hosts/common/darwin/core/default.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
{...}: {
{
flake,
system,
hostname,
...
}: {
# Used for backwards compatibility,
# please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 4;

# TODO https://discourse.nixos.org/t/give-name-label-comment-to-generations/45355
system.configurationRevision = flake.rev or flake.dirtyRev or null;

# The platform the configuration will be used on.
nixpkgs.hostPlatform = system;

networking = {
computerName = "${hostname}";
hostName = "${hostname}";
localHostName = "${hostname}";
};

environment.systemPath = ["/opt/homebrew/bin"];
}
6 changes: 4 additions & 2 deletions hosts/common/users/refnode/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
config,
pkgs,
username,
homeDirectory,
...
}: {
home-manager.users.refnode = import ../../../../users/refnode/default.nix;
home-manager.users.${username} = import ../../../../users/${username}/default.nix;

imports = [
../../../../users/refnode/common/darwin
../../../../users/${username}/common/darwin
];
}
53 changes: 23 additions & 30 deletions hosts/defiant/default.nix
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
{
pkgs,
lib,
flake,
system,
inputs,
...
}: {
imports = [
inputs.home-manager.darwinModules.home-manager
../common/core
../common/darwin/core
../common/users/refnode
];

# TODO https://discourse.nixos.org/t/give-name-label-comment-to-generations/45355
system.configurationRevision = flake.rev or flake.dirtyRev or null;

# Used for backwards compatibility,
# please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 4;

# The platform the configuration will be used on.
nixpkgs.hostPlatform = system;

networking = {
computerName = "defiant";
hostName = "defiant";
localHostName = "defiant";
};

# home-manager.users.refnode = import ../../users/refnode;
}
}: let
system = "aarch64-darwin";
hostname = "defiant";
username = "refnode";
homeDirectory = "/Users/${username}";
in
lib.darwinSystem {
inherit system;
modules = [
# ./hosts/defiant
inputs.home-manager.darwinModules.home-manager
../common/core
../common/darwin/core
# probably I need to import the nix-darwin for a user first
# and the import the home-manager config after
../common/users/${username}
];
specialArgs = {
inherit flake inputs system hostname username homeDirectory;
pkgs = lib.refnode.pkgsFor.aarch64-darwin;
};
}
1 change: 1 addition & 0 deletions users/refnode/common/darwin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
}: {
imports = [
./aerospace.nix
./service-keepassxc.nix
];
}
20 changes: 20 additions & 0 deletions users/refnode/common/darwin/service-keepassxc.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
config,
lib,
pkgs,
homeDirectory,
...
}: let
serviceName = "io.refnode.keepassxc";
in {
launchd.user.agents.keepassxc = {
serviceConfig = {
Label = serviceName;
StandardOutPath = "${homeDirectory}/Library/Logs/${serviceName}.log";
StandardErrorPath = "${homeDirectory}/Library/Logs/${serviceName}.error.log";
KeepAlive = true;
RunAtLoad = true;
Program = "${pkgs.keepassxc}/Applications/KeePassXC.app/Contents/MacOS/KeePassXC";
};
};
}
3 changes: 3 additions & 0 deletions users/refnode/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
pkgs.garden
unstable.cargo
unstable.rust-analyzer
unstable.talosctl
unstable.cilium-cli
unstable.jujutsu
];

home.sessionVariables = {
Expand Down
Loading