Skip to content

Commit

Permalink
refactor(flake): switch to unstable branch for entire nixos system
Browse files Browse the repository at this point in the history
  • Loading branch information
zakuciael committed Nov 1, 2024
1 parent 06a73a0 commit a3ae636
Show file tree
Hide file tree
Showing 30 changed files with 80 additions and 133 deletions.
7 changes: 2 additions & 5 deletions configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,11 @@ with lib.my; {
experimental-features = nix-command flakes
!include ${config.sops.templates."nix/access_tokens.conf".path}
'';
package = pkgs.nixFlakes;
package = pkgs.nixVersions.latest;
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
};

nixpkgs.config = {
allowBroken = false;
allowUnfree = true;
};
nixpkgs.pkgs = pkgs;

# System time
time.timeZone = "Europe/Warsaw";
Expand Down
44 changes: 13 additions & 31 deletions flake.lock

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

24 changes: 9 additions & 15 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
description = "A Super-Duper Invincible Shining Sparkly Magic NixOS Config"; # Credits: Genshin Impact

inputs = {
nixpkgs.url = "nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
nixpkgs.url = "nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
flake-utils.url = "github:numtide/flake-utils";
flake-compat.url = "github:edolstra/flake-compat";
nix-colors.url = "github:misterio77/nix-colors";
catppuccin.url = "github:catppuccin/nix";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
distro-grub-themes = {
Expand All @@ -34,7 +33,7 @@
inputs.flake-utils.follows = "flake-utils";
};
aagl = {
url = "github:ezKEa/aagl-gtk-on-nix/release-24.05";
url = "github:ezKEa/aagl-gtk-on-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-compat.follows = "flake-compat";
};
Expand All @@ -56,16 +55,11 @@

pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;

overlays = lib.my.overlays.pkgs;
};

unstable = import inputs.nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
config = {
allowUnfree = true;
};

overlays = lib.my.overlays.unstable;
overlays = lib.my.overlays.pkgs ++ lib.singleton (inputs.aagl.overlays.default);
};

inputs =
Expand Down Expand Up @@ -97,7 +91,7 @@
lib = nixpkgs.lib.extend (self: super: {
hm = home-manager.lib.hm;
my = import ./lib {
inherit lib pkgs unstable inputs username system;
inherit lib pkgs inputs username system;
};
});
in {
Expand All @@ -110,6 +104,6 @@

devShells.${system}.default = pkgs.callPackage ./shell.nix {};

inherit pkgs unstable inputs lib;
inherit pkgs inputs lib;
};
}
9 changes: 4 additions & 5 deletions lib/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
lib,
pkgs,
unstable,
inputs,
username,
system,
Expand All @@ -12,11 +11,11 @@
defs = import ./defs.nix {inherit lib;};

dotfiles = mapper.mapDirToAttrs ./../dotfiles;
scripts = import ./scripts.nix {inherit lib pkgs unstable inputs username dotfiles;};
scripts = import ./scripts.nix {inherit lib pkgs inputs username dotfiles;};
in {
inherit utils mapper defs;

hosts = import ./hosts.nix {inherit lib pkgs unstable inputs username dotfiles scripts;};
desktop = import ./desktop.nix {inherit lib pkgs unstable inputs username dotfiles scripts;};
overlays = import ./overlays.nix {inherit lib pkgs unstable inputs system;};
hosts = import ./hosts.nix {inherit lib pkgs inputs username dotfiles scripts;};
desktop = import ./desktop.nix {inherit lib pkgs inputs username dotfiles scripts;};
overlays = import ./overlays.nix {inherit lib pkgs inputs system;};
}
3 changes: 1 addition & 2 deletions lib/desktop.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
lib,
pkgs,
unstable,
inputs,
username,
dotfiles,
Expand All @@ -12,7 +11,7 @@ with lib;
with lib.my; let
mkDesktopApp = config: name: desktop:
import ./../modules/desktop/apps/${name}.nix {
inherit config lib pkgs unstable inputs username dotfiles scripts desktop;
inherit config lib pkgs inputs username dotfiles scripts desktop;
colorScheme = assert assertMsg
(config.home-manager.users.${username}.colorScheme.author != "")
"You need to select a nix-colors theme to use this ${name} config";
Expand Down
3 changes: 1 addition & 2 deletions lib/hosts.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
lib,
pkgs,
unstable,
inputs,
username,
dotfiles,
Expand All @@ -14,7 +13,7 @@ with lib.my; {
inherit (pkgs) system;

specialArgs = {
inherit lib pkgs unstable inputs username dotfiles scripts;
inherit lib pkgs inputs username dotfiles scripts;
hostname = name;
};

Expand Down
12 changes: 2 additions & 10 deletions lib/overlays.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
lib,
pkgs,
unstable,
inputs,
system,
...
Expand All @@ -10,7 +9,7 @@ with lib;
with lib.my; let
overlays =
builtins.map
(file: import file {inherit lib pkgs unstable inputs system;})
(file: import file {inherit lib pkgs inputs system;})
(utils.recursiveReadDir ./../overlays {suffixes = ["nix"];});
privatePkgsOverlays = let
suffix = "default.nix";
Expand All @@ -25,13 +24,6 @@ with lib.my; let
}
))
(utils.recursiveReadDir ./../pkgs {suffixes = [suffix];});
getOverlaysFromAttr = attr:
flatten (
builtins.filter
(overlay: overlay != null)
(builtins.map (config: attrByPath [attr] null config) overlays)
);
in {
pkgs = privatePkgsOverlays ++ (getOverlaysFromAttr "pkgs");
unstable = getOverlaysFromAttr "unstable";
pkgs = privatePkgsOverlays ++ flatten (builtins.filter (overlay: overlay != null) overlays);
}
3 changes: 1 addition & 2 deletions lib/scripts.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
lib,
pkgs,
unstable,
inputs,
username,
dotfiles,
Expand All @@ -12,7 +11,7 @@ with lib.my; let
mkScripts = config:
builtins.filter (value: hasAttrByPath ["package"] value) (
builtins.map
(file: import file {inherit config lib pkgs unstable inputs username dotfiles;})
(file: import file {inherit config lib pkgs inputs username dotfiles;})
(utils.recursiveReadDir ./../scripts {suffixes = ["nix"];})
);
in {
Expand Down
7 changes: 3 additions & 4 deletions modules/desktop/apps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
config,
lib,
pkgs,
unstable,
inputs,
username,
...
Expand Down Expand Up @@ -34,19 +33,19 @@ in {
google-chrome

# Files
cinnamon.nemo
nemo
libsForQt5.ark

# Music, Videos, Photos, etc.
spotify
gnome.eog
eog
gnome-text-editor
vlc
qalculate-gtk

# Other
font-manager
unstable.ytmdesktop
ytmdesktop
];
};
};
Expand Down
9 changes: 3 additions & 6 deletions modules/desktop/apps/_1password.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
config,
lib,
pkgs,
unstable,
inputs,
username,
desktop,
...
Expand All @@ -24,12 +22,12 @@ in {
programs = {
_1password = {
enable = true;
package = unstable._1password-beta;
package = pkgs._1password-cli-beta;
};
_1password-gui = {
enable = true;
polkitPolicyOwners = [username];
package = unstable._1password-gui-beta;
package = pkgs._1password-gui-beta;
};

fish.interactiveShellInit = ''
Expand Down Expand Up @@ -95,8 +93,7 @@ in {
"center, class:(${class})"
"monitor ${monitor}, class:(${class})"
# "stayfocused,class:^(${class})$"
# "forceinput,class:^(${class})$" # FIXME: Not working on flake Hyprland
# "windowdance,class:^(${class})$" # FIXME: Not working on flake Hyprland
"allowsinput on,class:^(${class})$"
"noblur,class:^(${class})$"
"noinitialfocus,class:^(${class})$"
"dimaround,class:^(${class})$"
Expand Down
5 changes: 2 additions & 3 deletions modules/desktop/apps/gtk.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
pkgs,
unstable,
username,
...
}: {
programs.dconf.enable = true;

home-manager.users.${username} = rec {
home = {
packages = with pkgs; [gnome.dconf-editor];
packages = with pkgs; [dconf-editor];

sessionVariables = {
XCURSOR_PATH = "${gtk.cursorTheme.package}/share/icons";
Expand All @@ -25,7 +24,7 @@
};
iconTheme = {
name = "WhiteSur-dark";
package = unstable.whitesur-icon-theme.override {
package = pkgs.whitesur-icon-theme.override {
boldPanelIcons = true;
alternativeIcons = true;
themeVariants = ["default"];
Expand Down
7 changes: 1 addition & 6 deletions modules/desktop/apps/nh.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
lib,
unstable,
...
}:
{lib, ...}:
with lib; {
programs.nh = {
enable = true;
package = unstable.nh;
clean = {
enable = true;
dates = "daily";
Expand Down
Loading

0 comments on commit a3ae636

Please sign in to comment.