From 3fc2c8d0c8c4a3c839fc12abad94ca83f4d21870 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 22 Apr 2023 12:07:54 +0200 Subject: Feat(flake): Modularize --- flake.nix | 111 ++++++++++++++++++++++---------------------------------------- 1 file changed, 39 insertions(+), 72 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 1925b1db..0c4167d5 100644 --- a/flake.nix +++ b/flake.nix @@ -3,13 +3,8 @@ description = "Nixos system config"; inputs = { + # base nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - home-manager = { - url = "github:nix-community/home-manager/master"; - inputs = { - nixpkgs.follows = "nixpkgs"; - }; - }; # inputs for following systems = { @@ -28,14 +23,12 @@ rust-overlay.follows = "rust-overlay"; }; }; - flake-utils = { url = "github:numtide/flake-utils"; inputs = { systems.follows = "systems"; }; }; - rust-overlay = { url = "github:oxalica/rust-overlay"; inputs = { @@ -44,6 +37,13 @@ }; }; + # nixos modules + home-manager = { + url = "github:nix-community/home-manager/master"; + inputs = { + nixpkgs.follows = "nixpkgs"; + }; + }; agenix = { url = "github:ryantm/agenix"; inputs = { @@ -65,7 +65,12 @@ inputs = { }; }; + nixos-generators = { + url = "github:nix-community/nixos-generators"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # my configs neovim_config = { url = "git+https://codeberg.org/soispha/neovim-config.git"; flake = false; @@ -76,6 +81,7 @@ }; }; + # my bins grades = { url = "git+https://codeberg.org/ene/Grades.git"; inputs = { @@ -130,6 +136,7 @@ }; }; + # external resources user_js = { url = "github:arkenfox/user.js"; flake = false; @@ -144,8 +151,9 @@ # core self, nixpkgs, - home-manager, # modules + home-manager, + nixos-generators, impermanence, agenix, ragenix, @@ -170,79 +178,38 @@ inherit (nixpkgs) lib; inherit system; }); - in { - nixosConfigurations = import ./flake/nixosConfigurations { + outputs = import ./flake { inherit - system + # core + self pkgs - nixpkgs + system sysLib + nixpkgs + # modules + home-manager - agenix + nixos-generators impermanence + agenix + ragenix + # external dependencies + + neovim_config + user_js + snap-sync templates + # my binaries + + video_pause + strip_js_comments + shell-library river_init_lesser yambar_memory yambar_cpu - video_pause grades - neovim_config - strip_js_comments - shell-library - user_js - snap-sync ; }; - packages."${system}" = { - install = import ./bootstrap/install { - inherit - pkgs - shell-library - ; - }; - activate = import ./bootstrap/activate { - inherit - pkgs - shell-library - ; - }; - setup = import ./bootstrap/setup { - inherit - pkgs - shell-library - ; - }; - config_setup = import ./bootstrap/config_setup { - inherit - pkgs - shell-library - ; - }; - }; - - apps."${system}" = { - install = { - type = "app"; - program = "${self.packages."${system}".install}/bin/install"; - }; - activate = { - type = "app"; - program = "${self.packages."${system}".activate}/bin/activate"; - }; - setup = { - type = "app"; - program = "${self.packages."${system}".setup}/bin/setup"; - }; - config_setup = { - type = "app"; - program = "${self.packages."${system}".config_setup}/bin/config_setup"; - }; - default = self.apps."${system}".activate; - }; - devShells."${system}" = { - default = pkgs.mkShell { - packages = with pkgs; [nil alejandra statix ragenix.packages."${system}".default shellcheck ltex-ls]; - }; - }; - }; + in + outputs; } -- cgit 1.4.1