Skip to content

Commit

Permalink
refactor: more changes infavor of macos
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Feb 15, 2024
1 parent dba0f23 commit d8163ff
Show file tree
Hide file tree
Showing 245 changed files with 897 additions and 738 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ lazy-lock.json -diff
# git lfs
*.png filter=lfs diff=lfs merge=lfs -text

# treat age files as binarys
*.age -text -diff

# templates should not register on linguist
flake/templates/* linguist-vendored
13 changes: 0 additions & 13 deletions .sops.yaml

This file was deleted.

48 changes: 38 additions & 10 deletions docs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
specialArgs = {inherit pkgs;};
};

gitHubDeclaration = user: repo: subpath: {
url = "https://github.com/${user}/${repo}/blob/main/${subpath}";
name = subpath;
};

mkDoc = name: options: let
doc = pkgs.nixosOptionsDoc {
options = filterAttrs (n: _: n != "_module") options;
Expand All @@ -32,12 +37,7 @@
map
(decl:
if lib.hasPrefix (toString ../.) (toString decl)
then let
subpath = removePrefix "/" (removePrefix (toString ../.) (toString decl));
in {
url = "https://github.com/isabelroses/dotfiles/tree/main/${subpath}";
name = subpath;
}
then gitHubDeclaration "isabelroses" "dotfiles" (removePrefix "/" (removePrefix (toString ../.) (toString decl)))
else decl)
opt.declarations;
};
Expand All @@ -54,9 +54,23 @@
convert = md:
pkgs.runCommand "isabelroses-dotfiles.html" {nativeBuildInputs = with pkgs; [pandoc texinfo];} ''
mkdir $out
cp ${./pandoc.css} style.css
pandoc -o file.texi ${builtins.concatStringsSep " " md}
texi2any ./file.texi --html --split=chapter --css-include=./style.css --document-language=en -o $out
pandoc \
--from markdown \
--to texinfo \
-o file.texi \
${builtins.concatStringsSep " " md}
sed -i "s/@top Top/@top isabelroses' modules/" file.texi
texi2any ./file.texi \
--html \
--split=chapter \
--css-include=${./pandoc.css} \
--document-language=en \
-o $out
substituteInPlace $out/index.html --replace "Top (isabelroses’ modules)" "isabelroses’ modules"
'';

modulesPath = ../modules;
Expand All @@ -73,5 +87,19 @@
hm = mkDoc "home-manager" hmEval.options;
in {
html = convert [nixos darwin hm];
md = pkgs.linkFarm "md" (lib.mapAttrsToList (name: path: {inherit name path;}) ["nixos" "darwin" "hm"]);

md = pkgs.linkFarm "md" [
{
name = "nixos";
path = extraModulesPath + /nixos;
}
{
name = "darwin";
path = extraModulesPath + /darwin;
}
{
name = "home-manager";
path = extraModulesPath + /home-manager;
}
];
}
121 changes: 80 additions & 41 deletions flake.lock

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

6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@
};

# Secrets, shhh
sops = {
url = "github:Mic92/sops-nix";
agenix = {
url = "github:ryantm/agenix";
inputs = {
nixpkgs.follows = "nixpkgs";
nixpkgs-stable.follows = "nixpkgs";
home-manager.follows = "home-manager";
};
};

Expand Down
4 changes: 2 additions & 2 deletions flake/pkgs/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_: {
{
perSystem = {
pkgs,
inputs',
Expand All @@ -7,7 +7,7 @@ _: {
packages = let
docs = pkgs.callPackage ../../docs {};
in {
# docs-md = docs.md;
docs-md = docs.md;
docs-html = docs.html;

lutgen-rs = pkgs.callPackage ./lutgen-rs.nix {};
Expand Down
1 change: 1 addition & 0 deletions flake/programs/devshell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
deadnix # clean up unused nix code
self'.formatter # nix formatter
config.treefmt.build.wrapper # treewide formatter
inputs'.agenix.packages.agenix # secrets
inputs'.deploy-rs.packages.deploy-rs # remote deployment
]
++ lib.optionals stdenv.isDarwin [inputs'.darwin.packages.darwin-rebuild];
Expand Down
2 changes: 1 addition & 1 deletion flake/templates/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_: {
{
flake.templates = {
c = {
path = ./c; # C/C++
Expand Down
Loading

0 comments on commit d8163ff

Please sign in to comment.