From 80f5faaed28b0823d0db802543c5de0f0499025b Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Fri, 23 Aug 2024 13:13:37 -0400 Subject: [PATCH] Added gbar flake --- flake.lock | 73 ++++++++++++++++++++++++++++++- flake.nix | 3 ++ modules/core/user.nix | 7 ++- modules/lib.nix | 3 +- modules/main.nix | 4 ++ modules/nixos/desktop/default.nix | 4 +- 6 files changed, 88 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index c1dab89..ab7343d 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,42 @@ { "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gBar": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1722546860, + "narHash": "sha256-27uYkBi5ZJT7w49mkoPWe8zNWl4P6o0JuaY6NRH6cD4=", + "owner": "scorpion-26", + "repo": "gBar", + "rev": "b1e2c2ed26a62058c502db3a03ac615f2567942e", + "type": "github" + }, + "original": { + "owner": "scorpion-26", + "repo": "gBar", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -58,6 +95,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1701040486, + "narHash": "sha256-vawYwoHA5CwvjfqaT3A5CT9V36Eq43gxdwpux32Qkjw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "45827faa2132b8eade424f6bdd48d8828754341a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1722869614, "narHash": "sha256-7ojM1KSk3mzutD7SkrdSflHXEujPvW1u7QuqWoTLXQU=", @@ -75,11 +128,12 @@ }, "root": { "inputs": { + "gBar": "gBar", "home-manager": "home-manager", "nix-darwin": "nix-darwin", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs", - "systems": "systems", + "nixpkgs": "nixpkgs_2", + "systems": "systems_2", "unstable": "unstable", "unstable-home-manager": "unstable-home-manager" } @@ -99,6 +153,21 @@ "type": "github" } }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "unstable": { "locked": { "lastModified": 1722630782, diff --git a/flake.nix b/flake.nix index 66ce744..04f2de5 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,7 @@ url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "unstable"; }; + gBar.url = "github:scorpion-26/gBar"; # Macos nix-darwin = { url = "github:LnL7/nix-darwin"; @@ -31,6 +32,7 @@ , home-manager , unstable-home-manager , nix-darwin + , gBar }: let user = { @@ -80,6 +82,7 @@ nix-darwin hlCommonSettings systems + gBar ; }; # Libs diff --git a/modules/core/user.nix b/modules/core/user.nix index fcd055c..3cd8438 100644 --- a/modules/core/user.nix +++ b/modules/core/user.nix @@ -10,6 +10,9 @@ in skyg.home-manager.version = mkOption { type = types.str; }; + skyg.home-manager.extraImports = mkOption { + default = [ ]; + }; skyg.user = { enabled = mkEnableOption ""; name = mkOption { @@ -48,6 +51,8 @@ in home-manager.users.root = (hm.makeRootUser { hostName = config.skyg.core.hostName; }) { pkgs = pkgs; }; home-manager.users.${cfg.user.name} = - (hm.makeCommonUser cfg.user) { pkgs = pkgs; }; + ((hm.makeCommonUser cfg.user) { pkgs = pkgs; }) // { + imports = cfg.home-manager.extraImports; + }; }; } diff --git a/modules/lib.nix b/modules/lib.nix index 0cdaeb2..f4b83a4 100644 --- a/modules/lib.nix +++ b/modules/lib.nix @@ -3,6 +3,7 @@ , nix-darwin , systems , hlCommonSettings +, gBar }: let makeImports = @@ -10,7 +11,7 @@ let , extraConfiguration ? [ ] }: (if (isNull attrs.configuration) then [ ] else [ attrs.configuration ]) ++ [ - (import ./main.nix attrs) + (import ./main.nix (attrs // { inherit gBar; })) ] ++ extraConfiguration; eachSystem = nixpkgs.lib.genAttrs (import systems); allPkgs = eachSystem (system: diff --git a/modules/main.nix b/modules/main.nix index da8a304..a8724b3 100644 --- a/modules/main.nix +++ b/modules/main.nix @@ -13,6 +13,7 @@ enable = false; } , localNixCaches ? { keys = [ ]; urls = [ ]; } +, gBar , ... }: { pkgs, ... }: { @@ -25,6 +26,9 @@ skyg.user = user; skyg.core.hostName = hostName; skyg.home-manager.version = homeManagerVersion; + skyg.home-manager.extraImports = [ + gBar.homeManagerModules.x86_64-linux.default + ]; skyg.core.substituters = localNixCaches; skyg.networkDrives.enabled = enableNetworkDrives; skyg.nixos.common.containers = (if os.enable then os.containers else { }); diff --git a/modules/nixos/desktop/default.nix b/modules/nixos/desktop/default.nix index 83ff98f..2d8e6ea 100644 --- a/modules/nixos/desktop/default.nix +++ b/modules/nixos/desktop/default.nix @@ -2,7 +2,7 @@ with lib; let - cfg = config.skyg.nixos.desktop; + cfg = config.skyg.nixos; in { imports = [ @@ -19,7 +19,7 @@ in "Enable Desktop"; }; }; - config = mkIf cfg.enabled { + config = mkIf cfg.desktop.enabled { services.displayManager.sddm.enable = true; services.displayManager.sddm.wayland.enable = true; };