Skip to content

Commit

Permalink
treewide: fix evaluation thanks to lib changes
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Dec 14, 2023
1 parent a0c0455 commit 8e3d2e4
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 25 deletions.
2 changes: 1 addition & 1 deletion home-manager/cli/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ in
];

options.home-manager.cli = {
enable = lib.mkDefaultOption "CLI config";
enable = lib.mkEnableOption "CLI config" // { default = true; };
enableGnu = lib.mkEnableOption "GNU utils config" // {
default = !pkgs.stdenv.isDarwin;
};
Expand Down
2 changes: 1 addition & 1 deletion home-manager/desktop/i3/i3status-rust.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ in
block = "disk_space";
path = m;
info_type = "available";
format = " $icon ${lib.shortPath m} $available ";
format = " $icon ${pkgs.lib.shortPath m} $available ";
})
cfg.mountPoints;

Expand Down
4 changes: 2 additions & 2 deletions home-manager/desktop/i3/picom.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, lib, osConfig, ... }:
{ config, pkgs, lib, osConfig, ... }:

{
options.home-manager.desktop.i3.picom.enable = lib.mkEnableOption "picom config" // {
Expand All @@ -8,7 +8,7 @@
config = lib.mkIf config.home-manager.desktop.i3.picom.enable {
services.picom = {
enable = true;
backend = if (lib.isNvidia osConfig) then "glx" else "egl";
backend = if (pkgs.lib.isNvidia osConfig) then "glx" else "egl";
fade = true;
fadeDelta = 2;
vSync = true;
Expand Down
2 changes: 1 addition & 1 deletion home-manager/desktop/sway/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ in
gtk = true;
};

extraOptions = lib.optionals (lib.isNvidia osConfig) [
extraOptions = lib.optionals (pkgs.lib.isNvidia osConfig) [
"--unsupported-gpu"
];
};
Expand Down
6 changes: 3 additions & 3 deletions home-manager/desktop/sway/waybar.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

let
cfg = config.home-manager.desktop.sway.waybar;
shortPathName = path: "disk#${lib.shortPathWithSep "_" path}";
shortPathName = path: "disk#${pkgs.lib.shortPathWithSep "_" path}";
in
{
options.home-manager.desktop.sway.waybar = {
Expand Down Expand Up @@ -96,12 +96,12 @@ in
format-icons = [ "󰤯" "󰤟" "󰤢" "󰤥" "󰤨" ];
};
} //
(lib.recursiveMergeAttrs
(pkgs.lib.recursiveMergeAttrs
(map
(m: {
"${shortPathName m}" = {
inherit (cfg) interval;
format = " ${lib.shortPath m}: {free}";
format = " ${pkgs.lib.shortPath m}: {free}";
path = m;
states = {
warning = 75;
Expand Down
4 changes: 3 additions & 1 deletion home-manager/editor/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
./vscode
];

options.home-manager.editor.enable = lib.mkDefaultOption "editor config";
options.home-manager.editor.enable = lib.mkEnableOption "editor config" // {
default = true;
};
}
2 changes: 1 addition & 1 deletion home-manager/editor/jetbrains.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
# TODO: add declarative IDE setup
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/jetbrains/readme.md
options.home-manager.editor.jetbrains.enable = lib.mkDefaultOption "Jetbrains IDEs config";
options.home-manager.editor.jetbrains.enable = lib.mkEnableOption "Jetbrains IDEs config";

config = lib.mkIf config.home-manager.editor.jetbrains.enable {
home.file = {
Expand Down
4 changes: 3 additions & 1 deletion home-manager/meta/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
./diff.nix
];

options.home-manager.meta.enable = lib.mkDefaultOption "Home-Manager config";
options.home-manager.meta.enable = lib.mkEnableOption "Home-Manager config" // {
default = true;
};

config = lib.mkIf config.home-manager.meta.enable {
# Add some Nix related packages
Expand Down
1 change: 0 additions & 1 deletion lib/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{ lib, ... }:

import ./attrsets.nix { inherit lib; } //
import ./modules.nix { inherit lib; } //
import ./utils.nix { inherit lib; }
6 changes: 0 additions & 6 deletions lib/modules.nix

This file was deleted.

2 changes: 1 addition & 1 deletion nixos/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ in
imports = [ flake.inputs.home-manager.nixosModules.home-manager ];

options.nixos.home = {
enable = lib.mkDefaultOption "home config";
enable = lib.mkEnableOption "home config" // { default = true; };
imports = lib.mkOption {
description = "Modules to import";
type = lib.types.listOf lib.types.path;
Expand Down
6 changes: 3 additions & 3 deletions nixos/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ in
];

options.nixos.nix = {
enable = lib.mkDefaultOption "nix/nixpkgs config";
tmpOnDisk = lib.mkDefaultOption "set nix's TMPDIR to /var/tmp (disk instead tmpfs)" // {
enable = config.boot.tmp.useTmpfs;
enable = lib.mkEnableOption "nix/nixpkgs config" // { default = true; };
tmpOnDisk = lib.mkEnableOption "set nix's TMPDIR to /var/tmp (disk instead tmpfs)" // {
default = config.boot.tmp.useTmpfs;
};
};

Expand Down
2 changes: 1 addition & 1 deletion nixos/server/rtorrent.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ in
options.nixos.server.rtorrent = {
enable = lib.mkEnableOption "rTorrent config";
flood = {
enable = lib.mkDefaultOption "Flood UI";
enable = lib.mkEnableOption "Flood UI" // { default = true; };
port = lib.mkOption {
type = lib.types.int;
description = "Port to bind webserver";
Expand Down
4 changes: 2 additions & 2 deletions nixos/system/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ in
];

options.nixos.system = {
enable = lib.mkDefaultOption "system config";
showMotd = lib.mkDefaultOption "show message of the day";
enable = lib.mkEnableOption "system config" // { default = true; };
showMotd = lib.mkEnableOption "show message of the day" // { default = true; };
};

config = lib.mkIf cfg.enable {
Expand Down

0 comments on commit 8e3d2e4

Please sign in to comment.