Skip to content

Commit

Permalink
Merge pull request #1423 from Mic92/merge-when-green-joerg
Browse files Browse the repository at this point in the history
update flakes
  • Loading branch information
Mic92 authored Jan 4, 2025
2 parents dbbc5a2 + 04a379e commit da055c5
Show file tree
Hide file tree
Showing 42 changed files with 323 additions and 267 deletions.
4 changes: 2 additions & 2 deletions darwin/evo/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
../modules/alacritty.nix
];

clan.core.clanDir = ../..;
clan.core.machineName = "evo";
clan.core.settings.directory = ../..;
clan.core.settings.machine.name = "evo";
sops.age.keyFile = "/Library/Application Support/sops-nix/age-key.txt";

# fix vim repeat key
Expand Down
106 changes: 69 additions & 37 deletions darwin/modules/clan/metadata.nix
Original file line number Diff line number Diff line change
@@ -1,46 +1,78 @@
{ lib, pkgs, ... }:
let
inherit (lib) mkOption types;
in
{
options.clan.core = {
clanName = lib.mkOption {
type = lib.types.str;
settings = mkOption {
description = ''
the name of the clan
'';
};
machineIcon = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = ''
the location of the machine icon
'';
};
machineDescription = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = ''
the description of the machine
'';
};
clanDir = lib.mkOption {
type = lib.types.path;
default = ./.;
description = ''
the location of the flake repo, used to calculate the location of facts and secrets
'';
};
clanIcon = lib.mkOption {
type = lib.types.nullOr lib.types.path;
description = ''
the location of the clan icon
'';
};
machineName = lib.mkOption {
type = lib.types.str;
default = "nixos";
description = ''
the name of the machine
Settings of the clan.
This is a read-only attribute-set available to the machines of the clan.
'';
type = types.submodule {
options = {
directory = mkOption {
type = types.path;
description = ''
the location of the flake repo, used to calculate the location of facts and secrets
'';
};
name = lib.mkOption {
type = lib.types.str;
description = ''
the name of the clan
'';
# Set by the flake, so it's read-only in the maschine
readOnly = true;
};
icon = lib.mkOption {
type = lib.types.nullOr lib.types.path;
description = ''
the location of the clan icon
'';
# Set by the flake, so it's read-only in the maschine
readOnly = true;
};
machine = mkOption {
description = ''
Settings of the machine.
This is a read-only attribute-set available to the machines of the clan.
'';
default = { };
type = types.submodule {
options = {
name = mkOption {
type = types.str;
default = "nixos";
description = ''
the name of the machine
'';
};
icon = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = ''
the location of the machine icon
'';
};
description = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = ''
the description of the machine
'';
};
};
};
};
};
};
};

# TODO: Move this into settings.clanPkgs ?
# This could also be part of the public interface to allow users to override the internal packages
clanPkgs = lib.mkOption {
defaultText = "self.packages.${pkgs.system}";
internal = true;
Expand Down
9 changes: 5 additions & 4 deletions darwin/modules/clan/sops.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
...
}:
let
secretsDir = config.clan.core.clanDir + "/sops/secrets";
groupsDir = config.clan.core.clanDir + "/sops/groups";
secretsDir = config.clan.core.settings.directory + "/sops/secrets";
groupsDir = config.clan.core.settings.directory + "/sops/groups";

# My symlink is in the nixos module detected as a directory also it works in the repl. Is this because of pure evaluation?
containsSymlink =
Expand All @@ -16,7 +16,8 @@ let

containsMachine =
parent: name: type:
type == "directory" && containsSymlink "${parent}/${name}/machines/${config.clan.core.machineName}";
type == "directory"
&& containsSymlink "${parent}/${name}/machines/${config.clan.core.settings.machine.name}";

containsMachineOrGroups =
name: type:
Expand Down Expand Up @@ -53,7 +54,7 @@ in
);

sops.age.keyFile = lib.mkIf (builtins.pathExists (
config.clan.core.clanDir + "/sops/secrets/${config.clan.core.machineName}-age.key/secret"
config.clan.core.clanDir + "/sops/secrets/${config.clan.core.settings.machine.name}-age.key/secret"
)) (lib.mkDefault "/var/lib/sops-nix/key.txt");
};
}
61 changes: 30 additions & 31 deletions flake.lock

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

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
flake-registry.url = "github:NixOS/flake-registry";
flake-registry.flake = false;

nix-darwin.url = "github:Mic92/nix-darwin/ssh";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";

#srvos.url = "github:numtide/srvos/impure-derivations";
Expand Down
29 changes: 2 additions & 27 deletions home-manager/desktop.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, inputs, ... }:
{ pkgs, ... }:
{
imports = [
./common.nix
Expand Down Expand Up @@ -29,7 +29,6 @@

arandr
signal-desktop
inputs.nur-packages.packages.${pkgs.hostPlatform.system}.pandoc-bin
adwaita-icon-theme
hicolor-icon-theme
graphicsmagick
Expand All @@ -40,7 +39,7 @@
hunspell
hunspellDicts.en-gb-ise
dino
foot
ghostty
screen-message
sshfs-fuse
sshuttle
Expand Down Expand Up @@ -91,30 +90,6 @@
--mode=block \
${pkgs.jellyfin-media-player}/bin/jellyfinmediaplayer
'')
#(retroarch.override {
# cores = [
# libretro.bsnes-hd
# libretro.mupen64plus
# libretro.beetle-psx-hw
# libretro.dolphin
# #libretro.pcsx2
# ];
#})

(pkgs.writeScriptBin "rhasspy-play" ''
#!${pkgs.runtimeShell}
set -eux -o pipefail
export PATH=${pkgs.pulseaudioFull}/bin:$PATH
sink=alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink
if pamixer --get-mute --sink="$sink"; then
pamixer --sink=$sink --unmute
paplay --device=$sink
pamixer --sink=$sink --mute
else
paplay --device=$sink
fi
'')

nixos-shell
nerd-fonts.fira-code
Expand Down
10 changes: 10 additions & 0 deletions home/.config/ghostty/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
font-family = ""
font-family = "FiraCode Nerd Font"
window-decoration = false
window-height = 4000
window-width = 4000
clipboard-read = allow
clipboard-write = allow

#theme = light:"Builtin Solarized Light",dark:"Builtin Solarized Dark"
theme = Builtin Solarized Light
4 changes: 2 additions & 2 deletions home/.config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
"nvim-notify": { "branch": "master", "commit": "29b33efc802a304b1cf13ab200915d4e9e67373d" },
"nvim-surround": { "branch": "main", "commit": "9f0cb495f25bff32c936062d85046fbda0c43517" },
"nvim-treesitter": { "branch": "master", "commit": "0c26a5c4bc407fdbca545ab25cf6084fd069444b" },
"nvim-treesitter": { "branch": "master", "commit": "5d18ef22dc63624e90aa7b6dbc17f2c3856ae716" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" },
"nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
Expand All @@ -71,7 +71,7 @@
"smart-splits.nvim": { "branch": "master", "commit": "00fba7a0e912a8d82da91a3b6b11d641fa500bd8" },
"spaceless.nvim": { "branch": "main", "commit": "8d46bc098dba18d4e19bce89bf19aab5007ef767" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
"telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" },
"telescope.nvim": { "branch": "0.1.x", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" },
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
"venv-selector.nvim": { "branch": "regexp", "commit": "e82594274bf7b54387f9a2abe65f74909ac66e97" },
Expand Down
2 changes: 1 addition & 1 deletion home/.config/nvim/treesitter-rev
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0c26a5c4bc407fdbca545ab25cf6084fd069444b
5d18ef22dc63624e90aa7b6dbc17f2c3856ae716
Loading

0 comments on commit da055c5

Please sign in to comment.