Skip to content

Commit

Permalink
flake: decommission work MacBook Pro (#74)
Browse files Browse the repository at this point in the history
Also removes the complexity required to deal with darwin system
configurations.
  • Loading branch information
britter authored Nov 12, 2024
1 parent ebdf80c commit 1c87da0
Show file tree
Hide file tree
Showing 58 changed files with 41 additions and 241 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,3 @@ jobs:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- run: nix build .#nixosConfigurations.minimal-server-iso.config.system.build.isoImage
build-darwin:
name: Build darwin systems
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- run: nix build .#darwinConfigurations.WQ0C6FWJ1W.config.system.build.toplevel
23 changes: 1 addition & 22 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-facter-modules.url = "github:numtide/nixos-facter-modules";
nixos-hardware.url = "github:nixos/nixos-hardware/master";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
Expand Down
6 changes: 2 additions & 4 deletions home/default.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{pkgs, ...}: {
{...}: {
imports = [
./desktop
./java
./profiles
./terminal
];
config = {
my.home = {
desktop.enable = pkgs.stdenv.isLinux;

desktop.enable = true;
java.enable = true;
terminal.enable = true;
};
Expand Down
7 changes: 6 additions & 1 deletion home/java/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ in {
package = pkgs.jdk21;
};

programs.gradle.enable = true;
programs.gradle = {
enable = true;
settings = {
"org.gradle.java.installations.paths" = "${pkgs.jdk8},${pkgs.jdk11}";
};
};

my.home.helix-java-support.enable = true;
};
Expand Down
19 changes: 0 additions & 19 deletions home/profiles/default.nix

This file was deleted.

38 changes: 0 additions & 38 deletions home/profiles/private.nix

This file was deleted.

40 changes: 0 additions & 40 deletions home/profiles/work.nix

This file was deleted.

17 changes: 17 additions & 0 deletions home/terminal/git.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@ in {
key = osUser.signingKey;
};

includes = [
{
condition = "gitdir:~/github/gradlex-org/";
contents = {
user.email = "[email protected]";
user.signingKey = "757DE51A2FD1489D";
};
}
{
condition = "gitdir:~/github/apache/";
contents = {
user.email = "[email protected]";
user.signingKey = "9DAADC1C9FCC82D0";
};
}
];

extraConfig = {
init.defaultBranch = "main";
push.autoSetupRemote = "true";
Expand Down
13 changes: 2 additions & 11 deletions lib.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
let
defineSystems = inputs: let
systems = builtins.mapAttrs (k: _v: builtins.readDir ./systems/${k}) (builtins.readDir ./systems);
configuration = builder: system: hostName:
builder {
nixosConfiguration = system: hostName:
inputs.nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
Expand All @@ -18,21 +18,12 @@ let
name = hostName;
value = builder arch hostName;
}) (builtins.attrNames systems.${arch});
nixosConfiguration = arch: hostName:
configuration inputs.nixpkgs.lib.nixosSystem arch hostName;
nixosConfigurations = let
nixosConfigurationAttrs = aarch: configurationAttrs nixosConfiguration aarch;
in
builtins.listToAttrs (nixosConfigurationAttrs "aarch64-linux" ++ nixosConfigurationAttrs "x86_64-linux");
darwinConfiguration = arch: hostName:
configuration inputs.nix-darwin.lib.darwinSystem arch hostName;
darwinConfigurations = let
darwinConfigurationAttrs = aarch: configurationAttrs darwinConfiguration aarch;
in
builtins.listToAttrs (darwinConfigurationAttrs "aarch64-darwin");
in {
inherit nixosConfigurations;
inherit darwinConfigurations;
};
lib = {
inherit defineSystems;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 0 additions & 7 deletions modules/common/default.nix

This file was deleted.

6 changes: 0 additions & 6 deletions modules/darwin/default.nix

This file was deleted.

21 changes: 0 additions & 21 deletions modules/darwin/my-user/default.nix

This file was deleted.

7 changes: 3 additions & 4 deletions modules/nixos/default.nix → modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
cfg = config.my.host;
in {
imports = [
../common
./1password
./acme
./adguard
Expand All @@ -14,6 +13,7 @@ in {
./gaming
./grafana
./homelab
./home-manager
./homepage
./https-proxy
./i18n
Expand All @@ -22,6 +22,7 @@ in {
./networking
./nextcloud
./nix
./options
./proxmox-vm
./sops
./sound
Expand All @@ -38,9 +39,7 @@ in {
my-user.enable = cfg.role == "desktop";
sound.enable = cfg.role == "desktop";
sway.enable = cfg.role == "desktop";

# enabled only on private desktops
gaming.enable = cfg.role == "desktop" && (builtins.elem "private" cfg.profiles);
gaming.enable = cfg.role == "desktop";

# enabled only on servers
comin.enable = cfg.role == "server";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ in {
imports = [
inputs.catppuccin.homeManagerModules.catppuccin
inputs.nixvim.homeManagerModules.nixvim
../../../home
../../home
];
};
};
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ in {
extraGroups = ["networkmanager" "wheel"];
shell = pkgs.fish;
};
programs.fish.enable = true;
my.modules.home-manager.enable = true;
# unfree packages used in home-manager configuration
my.modules.allowedUnfreePkgs = [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
type = types.enum ["desktop" "server"];
description = "The role this machine has";
};
profiles = mkOption {
type = types.listOf (types.enum ["private" "work"]);
description = "The profiles to enable on this host";
default = [];
};
};
user = {
name = mkOption {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
42 changes: 0 additions & 42 deletions systems/aarch64-darwin/WQ0C6FWJ1W/configuration.nix

This file was deleted.

Loading

0 comments on commit 1c87da0

Please sign in to comment.