feat: add nix-on-droid to flake

This commit is contained in:
matt1432 2023-12-08 14:59:44 -05:00
parent 13f0062331
commit 75a52aa5ae
5 changed files with 273 additions and 5 deletions

View file

@ -13,11 +13,13 @@ with lib; let
nvim-treesitter-hypr = tree-sitter-hypr-flake.packages.${pkgs.system}.default;
coc-stylelintplus = coc-stylelintplus-flake.packages.${pkgs.system}.default;
in {
home.packages = optionalAttrs nvimIde (with pkgs; [
gradle
gradle-completion # FIXME: not working
alejandra
]);
home = optionalAttrs nvimIde {
packages = with pkgs; [
gradle
gradle-completion # FIXME: not working
alejandra
];
};
xdg.dataFile = optionalAttrs nvimIde {
".gradle/gradle.properties".text = ''

80
common/nix-on-droid.nix Normal file
View file

@ -0,0 +1,80 @@
{
config,
nixpkgs,
nur,
pkgs,
...
}: {
imports = [
./vars.nix
./pkgs
nur.nixosModules.nur
];
nix = {
# Edit nix.conf
extraOptions = ''
experimental-features = nix-command flakes
keep-outputs = true
keep-derivations = true
auto-optimise-store = true
warn-dirty = false
'';
# Minimize dowloads of indirect nixpkgs flakes
registry.nixpkgs = {
flake = nixpkgs;
exact = false;
};
substituters = [
# Neovim and stuff
"https://nix-community.cachix.org"
];
trustedPublicKeys = [
# Neovim and stuff
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
# Global hm settings
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
config = {
imports = [
# Make the vars be the same on Nix and HM
./vars.nix
{vars = config.vars;}
nur.hmModules.nur
./home
./pkgs
];
home.packages =
[
config.customPkgs.repl
]
++ (with pkgs.nodePackages; [
undollar
])
++ (with pkgs; [
dracula-theme
neofetch
progress
wget
tree
mosh
rsync
killall
imagemagick
usbutils
]);
home.stateVersion = "23.05";
};
};
}

View file

@ -0,0 +1,45 @@
{pkgs, ...}: {
vars = {
user = "nix-on-droid";
hostName = "localhost";
neovimIde = false;
};
terminal.font = "${(pkgs.nerdfonts.override {
fonts = [
"JetBrainsMono"
];
})}/share/fonts/truetype/NerdFonts/JetBrainsMonoNerdFontMono-Regular.ttf";
environment.packages = with pkgs; [
diffutils
findutils
utillinux
tzdata
hostname
man
gnugrep
ripgrep
gnupg
gnused
gnutar
bzip2
gzip
xz
zip
unzip
openssh
perl
alejandra
];
environment.etcBackupExtension = ".bak";
environment.motd = null;
home-manager.backupFileExtension = "hm-bak";
# Set your time zone.
time.timeZone = "America/Montreal";
# No touchy
system.stateVersion = "23.05";
}

View file

@ -502,6 +502,29 @@
"type": "github"
}
},
"nix-formatter-pack": {
"inputs": {
"nixpkgs": [
"nix-on-droid",
"nixpkgs"
],
"nmd": "nmd",
"nmt": "nmt"
},
"locked": {
"lastModified": 1666720474,
"narHash": "sha256-iWojjDS1D19zpeZXbBdjWb9MiKmVVFQCqtJmtTXgPx8=",
"owner": "Gerschtli",
"repo": "nix-formatter-pack",
"rev": "14876cc8fe94a3d329964ecb073b4c988c7b61f5",
"type": "github"
},
"original": {
"owner": "Gerschtli",
"repo": "nix-formatter-pack",
"type": "github"
}
},
"nix-gaming": {
"inputs": {
"flake-parts": "flake-parts_3",
@ -581,6 +604,32 @@
"type": "github"
}
},
"nix-on-droid": {
"inputs": {
"home-manager": [
"home-manager"
],
"nix-formatter-pack": "nix-formatter-pack",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-for-bootstrap": "nixpkgs-for-bootstrap",
"nmd": "nmd_2"
},
"locked": {
"lastModified": 1694604941,
"narHash": "sha256-KsoRStRs8dNRRMWQhuB3eUOpzQhOc4dcBQB85tEq3wY=",
"owner": "t184256",
"repo": "nix-on-droid",
"rev": "039379abeee67144d4094d80bbdaf183fb2eabe5",
"type": "github"
},
"original": {
"owner": "t184256",
"repo": "nix-on-droid",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1701263465,
@ -597,6 +646,22 @@
"type": "github"
}
},
"nixpkgs-for-bootstrap": {
"locked": {
"lastModified": 1686921029,
"narHash": "sha256-J1bX9plPCFhTSh6E3TWn9XSxggBh/zDD4xigyaIQBy8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c7ff1b9b95620ce8728c0d7bd501c458e6da9e04",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c7ff1b9b95620ce8728c0d7bd501c458e6da9e04",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
@ -763,6 +828,54 @@
"type": "github"
}
},
"nmd": {
"flake": false,
"locked": {
"lastModified": 1666190571,
"narHash": "sha256-Z1hc7M9X6L+H83o9vOprijpzhTfOBjd0KmUTnpHAVjA=",
"owner": "rycee",
"repo": "nmd",
"rev": "b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169",
"type": "gitlab"
},
"original": {
"owner": "rycee",
"repo": "nmd",
"type": "gitlab"
}
},
"nmd_2": {
"flake": false,
"locked": {
"lastModified": 1666190571,
"narHash": "sha256-Z1hc7M9X6L+H83o9vOprijpzhTfOBjd0KmUTnpHAVjA=",
"owner": "rycee",
"repo": "nmd",
"rev": "b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169",
"type": "gitlab"
},
"original": {
"owner": "rycee",
"repo": "nmd",
"type": "gitlab"
}
},
"nmt": {
"flake": false,
"locked": {
"lastModified": 1648075362,
"narHash": "sha256-u36WgzoA84dMVsGXzml4wZ5ckGgfnvS0ryzo/3zn/Pc=",
"owner": "rycee",
"repo": "nmt",
"rev": "d83601002c99b78c89ea80e5e6ba21addcfe12ae",
"type": "gitlab"
},
"original": {
"owner": "rycee",
"repo": "nmt",
"type": "gitlab"
}
},
"nur": {
"locked": {
"lastModified": 1702020171,
@ -830,6 +943,7 @@
"nix-gaming": "nix-gaming",
"nix-index-db": "nix-index-db",
"nix-melt": "nix-melt",
"nix-on-droid": "nix-on-droid",
"nixpkgs": "nixpkgs_4",
"nixpkgs-wayland": "nixpkgs-wayland",
"nur": "nur",

View file

@ -3,6 +3,8 @@
self,
home-manager,
nixpkgs,
nix-on-droid,
neovim-flake,
secrets,
...
}: let
@ -37,6 +39,25 @@
];
};
nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration {
extraSpecialArgs = inputs;
home-manager-path = home-manager.outPath;
pkgs = import nixpkgs {
system = "aarch64-linux";
overlays = [
nix-on-droid.overlays.default
neovim-flake.overlay
(import ./common/overlays/dracula-theme)
];
};
modules = [
{home-manager.extraSpecialArgs = inputs;}
./common/nix-on-droid.nix
./devices/android
];
};
formatter = perSystem (_: pkgs: pkgs.alejandra);
};
@ -47,6 +68,12 @@
inputs.nixpkgs.follows = "nixpkgs";
};
nix-on-droid = {
url = "github:t184256/nix-on-droid";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
nur.url = "github:nix-community/NUR";