tangled
alpha
login
or
join now
da157.id
/
potatofox
1
fork
atom
this repo has no description
1
fork
atom
overview
issues
pulls
pipelines
feat: add nix flake + homeModule
awwpotato
8 months ago
fe4fd5a9
89dc6264
+179
-1
5 changed files
expand all
collapse all
unified
split
.editorconfig
.forgejo
workflows
check.yml
flake.lock
flake.nix
homeModule.nix
+1
-1
.editorconfig
···
6
6
indent_style = space
7
7
indent_size = 4
8
8
9
9
-
[*.{md,yaml,yml,css}]
9
9
+
[*.{md,yaml,yml,css,nix}]
10
10
indent_size = 2
+20
.forgejo/workflows/check.yml
···
1
1
+
---
2
2
+
name: Checks
3
3
+
4
4
+
on:
5
5
+
push:
6
6
+
pull_request:
7
7
+
8
8
+
jobs:
9
9
+
check:
10
10
+
runs-on: codeberg-small
11
11
+
12
12
+
steps:
13
13
+
- name: Checkout
14
14
+
uses: actions/checkout@v4
15
15
+
- name: Install Nix
16
16
+
uses: https://github.com/DeterminateSystems/nix-installer-action@v16
17
17
+
- name: Check Formatting
18
18
+
run: nix fmt -- --ci
19
19
+
- name: Flake Check
20
20
+
run: nix flake check -L
+64
flake.lock
···
1
1
+
{
2
2
+
"nodes": {
3
3
+
"flake-parts": {
4
4
+
"inputs": {
5
5
+
"nixpkgs-lib": [
6
6
+
"nixpkgs"
7
7
+
]
8
8
+
},
9
9
+
"locked": {
10
10
+
"lastModified": 1751413152,
11
11
+
"narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=",
12
12
+
"owner": "hercules-ci",
13
13
+
"repo": "flake-parts",
14
14
+
"rev": "77826244401ea9de6e3bac47c2db46005e1f30b5",
15
15
+
"type": "github"
16
16
+
},
17
17
+
"original": {
18
18
+
"owner": "hercules-ci",
19
19
+
"repo": "flake-parts",
20
20
+
"type": "github"
21
21
+
}
22
22
+
},
23
23
+
"nixpkgs": {
24
24
+
"locked": {
25
25
+
"lastModified": 1751271578,
26
26
+
"narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=",
27
27
+
"owner": "nixos",
28
28
+
"repo": "nixpkgs",
29
29
+
"rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df",
30
30
+
"type": "github"
31
31
+
},
32
32
+
"original": {
33
33
+
"owner": "nixos",
34
34
+
"ref": "nixos-unstable",
35
35
+
"repo": "nixpkgs",
36
36
+
"type": "github"
37
37
+
}
38
38
+
},
39
39
+
"root": {
40
40
+
"inputs": {
41
41
+
"flake-parts": "flake-parts",
42
42
+
"nixpkgs": "nixpkgs",
43
43
+
"systems": "systems"
44
44
+
}
45
45
+
},
46
46
+
"systems": {
47
47
+
"locked": {
48
48
+
"lastModified": 1681028828,
49
49
+
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
50
50
+
"owner": "nix-systems",
51
51
+
"repo": "default",
52
52
+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
53
53
+
"type": "github"
54
54
+
},
55
55
+
"original": {
56
56
+
"owner": "nix-systems",
57
57
+
"repo": "default",
58
58
+
"type": "github"
59
59
+
}
60
60
+
}
61
61
+
},
62
62
+
"root": "root",
63
63
+
"version": 7
64
64
+
}
+57
flake.nix
···
1
1
+
{
2
2
+
description = "potatofox";
3
3
+
4
4
+
inputs = {
5
5
+
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
6
6
+
7
7
+
flake-parts = {
8
8
+
url = "github:hercules-ci/flake-parts";
9
9
+
inputs.nixpkgs-lib.follows = "nixpkgs";
10
10
+
};
11
11
+
12
12
+
systems.url = "github:nix-systems/default";
13
13
+
};
14
14
+
15
15
+
outputs =
16
16
+
inputs:
17
17
+
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
18
18
+
systems = import inputs.systems;
19
19
+
20
20
+
perSystem =
21
21
+
{ pkgs, ... }:
22
22
+
{
23
23
+
formatter = pkgs.treefmt.withConfig {
24
24
+
runtimeInputs = with pkgs; [
25
25
+
nixfmt-rfc-style
26
26
+
deadnix
27
27
+
prettier
28
28
+
];
29
29
+
30
30
+
settings = {
31
31
+
on-unmatched = "info";
32
32
+
tree-root-file = "flake.nix";
33
33
+
34
34
+
formatter = {
35
35
+
nixfmt = {
36
36
+
command = "nixfmt";
37
37
+
includes = [ "*.nix" ];
38
38
+
};
39
39
+
deadnix = {
40
40
+
command = "deadnix";
41
41
+
includes = [ "*.nix" ];
42
42
+
};
43
43
+
prettier = {
44
44
+
command = "prettier";
45
45
+
includes = [ "*.css" ];
46
46
+
};
47
47
+
};
48
48
+
};
49
49
+
};
50
50
+
};
51
51
+
52
52
+
flake.homeModules = rec {
53
53
+
default = potatofox;
54
54
+
potatofox = import ./homeModule.nix;
55
55
+
};
56
56
+
};
57
57
+
}
+37
homeModule.nix
···
1
1
+
{
2
2
+
lib,
3
3
+
config,
4
4
+
...
5
5
+
}:
6
6
+
let
7
7
+
browsers = [
8
8
+
"firefox"
9
9
+
"librewolf"
10
10
+
];
11
11
+
in
12
12
+
{
13
13
+
options.programs = lib.genAttrs browsers (_name: {
14
14
+
potatofox = {
15
15
+
enable = lib.mkEnableOption "potatofox";
16
16
+
profiles = lib.mkOption {
17
17
+
type = lib.types.listOf lib.types.str;
18
18
+
default = [ ];
19
19
+
example = [ "default" ];
20
20
+
};
21
21
+
};
22
22
+
});
23
23
+
24
24
+
config.home.file = lib.mkMerge (
25
25
+
map (
26
26
+
name:
27
27
+
lib.mkIf config.programs.${name}.potatofox.enable (
28
28
+
map (n: {
29
29
+
".${if name == "librewolf" then name else ".mozzila/${name}"}/${n}/chrome" = {
30
30
+
source = ./chrome;
31
31
+
recursive = true;
32
32
+
};
33
33
+
}) config.options.programs.${name}.potatofox.profiles
34
34
+
)
35
35
+
) browsers
36
36
+
);
37
37
+
}