flakes/flake.nix

121 lines
5.5 KiB
Nix
Raw Normal View History

2021-05-11 14:32:58 +07:00
{
inputs = {
2021-07-14 07:42:25 +07:00
nixpkgs.url = "github:NixOS/nixpkgs";
2021-07-04 21:25:20 +07:00
home-manager.url = "github:nix-community/home-manager";
2021-07-05 10:40:52 +07:00
neovim-nightly.url = "github:nix-community/neovim-nightly-overlay";
2021-09-20 15:09:44 +07:00
agenix.url = "github:ryantm/agenix";
2021-09-20 15:09:44 +07:00
agenix.inputs.nixpkgs.follows = "nixpkgs";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
2021-07-05 10:40:52 +07:00
neovim-nightly.inputs.nixpkgs.follows = "nixpkgs";
2021-07-14 11:02:42 +07:00
2021-09-04 14:14:42 +07:00
nix-gaming.url = "github:fufexan/nix-gaming";
powercord-overlay.url = "github:LavaDesu/powercord-overlay";
powercord-overlay.inputs.nixpkgs.follows = "nixpkgs";
2021-07-14 11:02:42 +07:00
# zsh plugins
zsh-abbr = { url = "github:olets/zsh-abbr"; flake = false; };
zsh-history-substring-search = { url = "github:zsh-users/zsh-history-substring-search"; flake = false; };
fast-syntax-highlighting = { url = "github:zdharma-continuum/fast-syntax-highlighting"; flake = false; };
2021-07-15 14:59:23 +07:00
pure = { url = "github:sindresorhus/pure"; flake = false; };
2021-07-18 14:10:58 +07:00
# overlays
discord-tokyonight = { url = "github:DanisDGK/zelk-customizations"; flake = false; };
2021-07-18 14:10:58 +07:00
discover = { url = "github:trigg/Discover"; flake = false; };
linux-tkg = { url = "github:Frogging-Family/linux-tkg"; flake = false; };
2021-10-10 14:03:12 +07:00
packwiz = { url = "github:comp500/packwiz"; flake = false; };
2021-09-19 11:31:11 +07:00
spotify-adblock = { url = "github:abba23/spotify-adblock"; flake = false; };
2021-09-05 11:36:43 +07:00
tree-sitter-glimmer = { url = "github:alexlafroscia/tree-sitter-glimmer"; flake = false; };
2021-09-05 15:57:23 +07:00
tree-sitter-jsonc = { url = "gitlab:WhyNotHugo/tree-sitter-jsonc"; flake = false; };
# powercord plugins/themes
better-status-indicators = { url = "github:griefmodz/better-status-indicators"; flake = false; };
channel-typing = { url = "github:powercord-community/channel-typing"; flake = false; };
discord-tweaks = { url = "github:NurMarvin/discord-tweaks"; flake = false; };
fix-user-popouts = { url = "github:cyyynthia/fix-user-popouts"; flake = false; };
no-double-back-pc = { url = "github:the-cord-plug/no-double-back-pc"; flake = false; };
powercord-popout-fix = { url = "github:Nexure/PowerCord-Popout-Fix"; flake = false; };
rolecolor-everywhere = { url = "github:powercord-community/rolecolor-everywhere"; flake = false; };
theme-toggler = { url = "github:redstonekasi/theme-toggler"; flake = false; };
twemoji-but-good = { url = "github:powercord-community/twemoji-but-good"; flake = false; };
view-raw = { url = "github:Juby210/view-raw"; flake = false; };
who-reacted = { url = "github:jaimeadf/who-reacted"; flake = false; };
radialstatus = { url = "github:DiscordStyles/RadialStatus"; flake = false; };
tokyonight = { url = "github:Dyzean/Tokyo-Night"; flake = false; };
zelk = { url = "github:schnensch0/zelk"; flake = false; };
2021-05-11 14:32:58 +07:00
};
2021-09-20 15:09:44 +07:00
outputs = { self, agenix, nixpkgs, home-manager, ... } @ inputs:
2021-05-13 17:59:46 +07:00
let
lib = nixpkgs.lib;
getPaths = root: builtins.map
(path: root + ("/" + path)) # Prepends root path
(builtins.attrNames (builtins.readDir root)); # Reads root path
modules =
2021-07-15 19:57:49 +07:00
let
getName = path: lib.removeSuffix ".nix" ( # Strip extension
lib.last ( # Gets the last part (filename)
lib.splitString "/" ( # Splits the path into components
builtins.toString path # Converts the path into a string
)
)
2021-07-15 19:57:49 +07:00
);
genModulePaths = basePath: builtins.listToAttrs (
builtins.map (path: {
name = getName path;
value = path;
}) (getPaths basePath)
);
in {
user = genModulePaths ./modules/user;
system = genModulePaths ./modules/system;
};
customPackages = pkgs:
let
callPackage = pkgs.callPackage;
in {
discord-tokyonight = callPackage ./packages/discord-tokyonight { inherit inputs; };
discover-overlay = callPackage ./packages/discover { inherit inputs; };
linux-lava = callPackage ./packages/linux-lava { inherit inputs; };
packwiz = callPackage ./packages/packwiz { inherit inputs; };
spotify-adblock = callPackage ./packages/spotify-adblock { inherit inputs; };
tree-sitter-glimmer = callPackage ./packages/tree-sitter-glimmer { inherit inputs; };
tree-sitter-jsonc = callPackage ./packages/tree-sitter-jsonc { inherit inputs; };
wine-osu = callPackage ./packages/wine-osu { inherit getPaths; };
};
2021-07-18 14:10:58 +07:00
overlays = [ (self: super: { inherit inputs; }) ] ++ (builtins.map
(path: import path) # Imports path
(builtins.filter
(path: lib.hasSuffix ".nix" path) # Checks file extension
(getPaths ./overlays)
)
2021-07-05 10:40:52 +07:00
) ++ [(self: super: customPackages super)]
++ [inputs.neovim-nightly.overlay]
++ [inputs.powercord-overlay.overlay];
mkSystem =
if !(self ? rev) then throw "Dirty git tree detected." else
name: arch: enableGUI: lib.nixosSystem {
system = arch;
modules = [
home-manager.nixosModules.home-manager
2021-09-20 15:09:44 +07:00
agenix.nixosModules.age
(./hosts + "/${name}")
];
specialArgs = { inherit inputs modules overlays enableGUI; };
};
2021-05-13 17:59:46 +07:00
in
{
2021-08-21 18:20:17 +07:00
nixosConfigurations."apricot" = mkSystem "apricot" "x86_64-linux" false;
2021-11-02 00:53:56 +07:00
nixosConfigurations."blossom" = mkSystem "blossom" "x86_64-linux" true;
2021-09-20 18:10:28 +07:00
nixosConfigurations."fondue" = mkSystem "fondue" "x86_64-linux" false;
2021-07-15 13:39:48 +07:00
packages.x86_64-linux = customPackages nixpkgs.legacyPackages.x86_64-linux;
2021-05-11 14:32:58 +07:00
};
}