Commit graph

12 commits

Author SHA1 Message Date
NAHO
dfc859f54d
treewide: optionalize mkTarget's humanName and name arguments
Optionalize mkTarget's 'humanName' and 'name' arguments by inferring
'humanName' from the 'name' attribute in the /modules/<MODULE>/meta.nix
file, and 'name' from the /modules/<NAME>/ directory name.

Inferring the 'humanName' and 'name' arguments ensures consistency and
reduces boilerplate.

The 'humanName' and 'name' arguments are optionalized instead of removed
because complex modules generating target derivations need to
distinguish between them.

Closes: https://github.com/nix-community/stylix/issues/1661
2025-12-10 14:48:37 +01:00
NAHO
5b9710eee9
treewide: remove optional builtins prefixes from prelude functions (#1915)
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd --type file --exec-batch sed --in-place --regexp-extended "
      s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
      ))\>/\1/g
    "

    nix fmt

This patch is heavily inspired by [1] ("treewide: remove optional
builtins prefixes from prelude functions").

[1]: https://github.com/NixOS/nixpkgs/pull/444432

Link: https://github.com/nix-community/stylix/pull/1915

Reviewed-by: Daniel Thwaites <danth@danth.me>
Reviewed-by: awwpotato <awwpotato@voidq.com>
2025-09-28 11:09:21 +02:00
NAHO
2e2e96f6b0
treewide: remove blank lines around 'let', 'in', and function arguments (#1700)
Link: https://github.com/nix-community/stylix/pull/1700

Reviewed-by: awwpotato <awwpotato@voidq.com>
2025-07-19 10:41:36 -07:00
NAHO
a294d8b2a3
stylix: fix 'unguarded' typo (#1613)
Fixes: dea0337e0b ("stylix: restrict access to config while using mkTarget (#1368)")
Link: https://github.com/nix-community/stylix/pull/1613

Reviewed-by: awwpotato <awwpotato@voidq.com>
2025-07-06 21:18:05 +00:00
awwpotato
dea0337e0b
stylix: restrict access to config while using mkTarget (#1368)
Link: https://github.com/nix-community/stylix/pull/1368

Reviewed-by: Flameopathic <64027365+Flameopathic@users.noreply.github.com>
Reviewed-by: Matt Sturgeon <matt@sturgeon.me.uk>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
2025-07-04 19:08:21 +02:00
Matt Sturgeon
9fb268f3a6
stylix: drop unnecessary use of self in autoload.nix 2025-05-28 19:20:58 +01:00
Flameopathic
c4fa684471 stylix: add mkTarget function
Add the mkTarget function, providing a consistent target interface to minimize boilerplate
and automatically safeguard declarations related to disabled options.

The mkTarget function was first discussed in [1] ("extensive mkTarget
function").

[1]: https://github.com/danth/stylix/discussions/1009
2025-05-21 09:39:49 -04:00
awwpotato
bcc674f199
stylix: simplify autoload.nix (#1001) 2025-03-15 12:09:19 +00:00
NAHO
ad64260a75
treewide: add and apply nixfmt pre-commit hook
Link: https://github.com/danth/stylix/pull/519
2025-01-04 17:48:26 +01:00
Alexey Lebedeff
9b61cc39b2
stylix: don't split autoloaded modules into a separate derivation (#631)
Apparently `../modules` is creating a separate derivation that contains
only that folder, so it's now separate from the flake source. But this
transient derivation isn't mentioned explicitly anywhere in the flake
outputs. It makes it impossible to target those modules in
`disabledModules` directive.

For example, after this change is applied, users can solve issues like
https://github.com/danth/stylix/issues/577 locally, by just adding the
following snippet to their configuration:

    disabledModules = [ "${inputs.stylix}/modules/regreet/nixos.nix" ];

Reviewed-by: Daniel Thwaites <danthwaites30@btinternet.com>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
2024-11-17 17:40:52 +01:00
Daniel Thwaites
80e8e1e2f6
treewide: add linters and apply pending suggestions (#426) 2024-06-16 15:08:25 +01:00
DwarfMaster
fbad7b1b0c Refactor modules to separate nixos from hm code 2023-01-30 22:56:57 +01:00