2024-03-04 00:34:39 +03:00
|
|
|
{
|
2024-11-04 04:37:29 +03:00
|
|
|
inputs = {
|
2024-11-18 10:48:27 +03:00
|
|
|
# SOURCE: https://github.com/NixOS/nixpkgs
|
2024-12-10 02:38:57 +03:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
|
2024-11-04 04:37:29 +03:00
|
|
|
nixpkgsUnstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
nixpkgsMaster.url = "github:nixos/nixpkgs/master";
|
|
|
|
|
2024-11-18 10:48:27 +03:00
|
|
|
# SOURCE: https://github.com/nix-community/home-manager
|
2024-11-23 10:46:00 +03:00
|
|
|
home-manager = {
|
2024-11-18 10:48:27 +03:00
|
|
|
url = "github:nix-community/home-manager/release-24.11";
|
2024-11-23 10:46:00 +03:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2024-11-18 10:48:27 +03:00
|
|
|
# SOURCE: https://github.com/nix-community/nix-on-droid
|
2024-11-04 04:37:29 +03:00
|
|
|
nix-on-droid = {
|
2024-11-15 01:42:21 +03:00
|
|
|
url = "github:t184256/nix-on-droid/release-24.05";
|
|
|
|
inputs = {
|
|
|
|
home-manager.follows = "home-manager";
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-11-04 04:37:29 +03:00
|
|
|
};
|
|
|
|
|
2024-11-18 10:48:27 +03:00
|
|
|
# SOURCE: https://github.com/LilleAila/nix-cursors
|
2024-11-23 10:46:00 +03:00
|
|
|
nix-cursors = {
|
|
|
|
url = "github:LilleAila/nix-cursors";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2024-11-18 10:48:27 +03:00
|
|
|
# SOURCE: https://github.com/danth/stylix
|
|
|
|
stylix = {
|
|
|
|
url = "github:danth/stylix/release-24.05";
|
|
|
|
inputs = {
|
|
|
|
home-manager.follows = "home-manager";
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nixpkgsJobber.url = "github:nixos/nixpkgs/051f920625ab5aabe37c920346e3e69d7d34400e";
|
|
|
|
poetry2nixJobber.url = "github:nix-community/poetry2nix/304f8235fb0729fd48567af34fcd1b58d18f9b95";
|
|
|
|
|
2024-11-04 04:37:29 +03:00
|
|
|
nvimAlign = { flake = false; url = "github:echasnovski/mini.align"; };
|
|
|
|
nvimAutoclose = { flake = false; url = "github:m4xshen/autoclose.nvim"; };
|
|
|
|
nvimBufferline = { flake = false; url = "github:akinsho/bufferline.nvim"; };
|
|
|
|
nvimCloseBuffers = { flake = false; url = "github:kazhala/close-buffers.nvim"; };
|
|
|
|
nvimColorizer = { flake = false; url = "github:brenoprata10/nvim-highlight-colors"; };
|
|
|
|
nvimDevicons = { flake = false; url = "github:nvim-tree/nvim-web-devicons"; };
|
|
|
|
nvimDressing = { flake = false; url = "github:stevearc/dressing.nvim"; };
|
|
|
|
nvimGen = { flake = false; url = "github:David-Kunz/gen.nvim"; };
|
|
|
|
nvimGitsigns = { flake = false; url = "github:lewis6991/gitsigns.nvim"; };
|
|
|
|
nvimGruvboxMaterial = { flake = false; url = "github:sainnhe/gruvbox-material"; };
|
|
|
|
nvimIndentoMatic = { flake = false; url = "github:Darazaki/indent-o-matic"; };
|
|
|
|
nvimLspconfig = { flake = false; url = "github:neovim/nvim-lspconfig"; };
|
|
|
|
nvimPlenary = { flake = false; url = "github:nvim-lua/plenary.nvim"; };
|
|
|
|
nvimTelescope = { flake = false; url = "github:nvim-telescope/telescope.nvim"; };
|
|
|
|
nvimTodo = { flake = false; url = "github:folke/todo-comments.nvim"; };
|
|
|
|
nvimTree = { flake = false; url = "github:nvim-tree/nvim-tree.lua"; };
|
|
|
|
nvimTreesitter = { flake = false; url = "github:nvim-treesitter/nvim-treesitter"; };
|
|
|
|
nvimTrouble = { flake = false; url = "github:folke/trouble.nvim"; };
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = {
|
|
|
|
home-manager,
|
|
|
|
nix-on-droid,
|
|
|
|
nixpkgs,
|
|
|
|
nixpkgsJobber,
|
|
|
|
nixpkgsMaster,
|
|
|
|
nixpkgsUnstable,
|
|
|
|
poetry2nixJobber,
|
|
|
|
self,
|
|
|
|
stylix,
|
|
|
|
...
|
2024-12-18 08:32:43 +03:00
|
|
|
} @inputs: let
|
|
|
|
lib = nixpkgs.lib;
|
|
|
|
|
2024-11-04 04:37:29 +03:00
|
|
|
const = {
|
2024-11-15 01:42:21 +03:00
|
|
|
droidStateVersion = "24.05";
|
|
|
|
stateVersion = "24.11";
|
2024-11-04 04:37:29 +03:00
|
|
|
timeZone = "Europe/Moscow";
|
|
|
|
url = "https://git.voronind.com/voronind/nix.git";
|
|
|
|
};
|
|
|
|
|
|
|
|
__findFile = _: p: ./${p};
|
|
|
|
|
2024-11-20 22:57:00 +03:00
|
|
|
ls = path: map (f: "${path}/${f}") (
|
2024-11-04 04:37:29 +03:00
|
|
|
builtins.filter (i: builtins.readFileType "${path}/${i}" == "regular") (
|
|
|
|
builtins.attrNames (builtins.readDir path)
|
|
|
|
)
|
|
|
|
);
|
2024-12-18 08:32:43 +03:00
|
|
|
in {
|
2024-11-04 04:37:29 +03:00
|
|
|
devShells = let
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
system = "x86_64-linux";
|
|
|
|
in {
|
|
|
|
${system}.default = pkgs.mkShell {
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
nixd
|
|
|
|
];
|
|
|
|
# buildInputs = with pkgs; [ ];
|
|
|
|
|
|
|
|
# LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}";
|
|
|
|
# SOURCE_DATE_EPOCH = "${toString self.lastModified}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nixosConfigurations = let
|
2024-12-18 08:32:43 +03:00
|
|
|
mkHost = { system, hostname }: lib.nixosSystem {
|
2024-11-04 04:37:29 +03:00
|
|
|
inherit system;
|
|
|
|
modules = [
|
|
|
|
# Make a device hostname match the one from this config.
|
|
|
|
{ networking.hostName = hostname; }
|
|
|
|
|
|
|
|
# Specify current release version.
|
2024-12-18 08:32:43 +03:00
|
|
|
{ system.stateVersion = const.stateVersion; }
|
2024-11-04 04:37:29 +03:00
|
|
|
|
|
|
|
# Add Home Manager module.
|
|
|
|
home-manager.nixosModules.home-manager
|
|
|
|
|
|
|
|
# Add Stylix module.
|
|
|
|
stylix.nixosModules.stylix
|
|
|
|
|
|
|
|
# HM config.
|
|
|
|
./home/NixOs.nix
|
|
|
|
]
|
2024-12-18 08:32:43 +03:00
|
|
|
++ (ls ./host/${system}/${hostname})
|
|
|
|
++ (ls ./option)
|
|
|
|
++ (ls ./config)
|
|
|
|
++ (ls ./overlay)
|
|
|
|
++ (ls ./system)
|
2024-11-04 04:37:29 +03:00
|
|
|
;
|
|
|
|
specialArgs = let
|
2024-12-02 21:12:45 +03:00
|
|
|
util = import ./lib/Util.nix { inherit lib; };
|
2024-11-04 04:37:29 +03:00
|
|
|
in {
|
2024-12-18 08:32:43 +03:00
|
|
|
inherit const __findFile inputs self poetry2nixJobber util;
|
2024-11-04 04:37:29 +03:00
|
|
|
pkgsJobber = nixpkgsJobber.legacyPackages.${system}.pkgs;
|
|
|
|
pkgsMaster = nixpkgsMaster.legacyPackages.${system}.pkgs;
|
|
|
|
pkgsUnstable = nixpkgsUnstable.legacyPackages.${system}.pkgs;
|
|
|
|
secret = import ./secret { };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
mkSystem = system: hostname: { "${hostname}" = mkHost { inherit system hostname; }; };
|
2024-12-18 08:32:43 +03:00
|
|
|
|
|
|
|
systems = builtins.attrNames (builtins.readDir ./host) |> map (system: {
|
|
|
|
inherit system;
|
|
|
|
hosts = builtins.attrNames (builtins.readDir ./host/${system});
|
|
|
|
});
|
|
|
|
|
|
|
|
hosts = map (system:
|
|
|
|
map (host: { inherit host; inherit (system) system; }) system.hosts
|
|
|
|
) systems |> lib.foldl' (acc: h: acc ++ h) [];
|
|
|
|
|
|
|
|
configurations = map (cfg: mkSystem cfg.system cfg.host) hosts;
|
|
|
|
in
|
|
|
|
lib.foldl' (result: cfg: result // cfg) {} configurations;
|
2024-11-04 04:37:29 +03:00
|
|
|
|
|
|
|
nixOnDroidConfigurations.default = let
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system}.pkgs;
|
|
|
|
pkgsMaster = nixpkgsMaster.legacyPackages.${system}.pkgs;
|
|
|
|
pkgsUnstable = nixpkgsUnstable.legacyPackages.${system}.pkgs;
|
|
|
|
system = "aarch64-linux";
|
|
|
|
in nix-on-droid.lib.nixOnDroidConfiguration {
|
2024-11-15 02:33:00 +03:00
|
|
|
inherit pkgs;
|
2024-11-04 04:37:29 +03:00
|
|
|
modules = [
|
2024-11-15 02:33:00 +03:00
|
|
|
{ home.android.enable = true; }
|
|
|
|
{ home-manager.config.stylix.autoEnable = lib.mkForce false; }
|
2024-11-04 04:37:29 +03:00
|
|
|
./home/Android.nix
|
2024-11-16 04:43:59 +03:00
|
|
|
]
|
2024-12-18 08:32:43 +03:00
|
|
|
++ (ls ./option)
|
2024-11-16 04:43:59 +03:00
|
|
|
;
|
2024-11-04 04:37:29 +03:00
|
|
|
extraSpecialArgs = {
|
2024-12-18 08:32:43 +03:00
|
|
|
inherit inputs self pkgsMaster pkgsUnstable const __findFile;
|
2024-11-04 04:37:29 +03:00
|
|
|
secret = import ./secret { };
|
|
|
|
util = import ./lib/Util.nix { inherit lib; };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-03-04 00:34:39 +03:00
|
|
|
}
|