mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 11:36:07 +01:00
templates: add templates for some use cases
This commit is contained in:
parent
8b33a28370
commit
f4edb7be86
8 changed files with 271 additions and 0 deletions
19
flake.nix
19
flake.nix
|
|
@ -53,6 +53,25 @@
|
|||
default = app;
|
||||
nix-on-droid = app;
|
||||
};
|
||||
|
||||
templates = {
|
||||
default = self.templates.minimal;
|
||||
|
||||
minimal = {
|
||||
path = ./templates/minimal;
|
||||
description = "Minimal example of nix-on-droid system config.";
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
path = ./templates/home-manager;
|
||||
description = "Minimal example of nix-on-droid system config with home-manager.";
|
||||
};
|
||||
|
||||
advanced = {
|
||||
path = ./templates/advanced;
|
||||
description = "Advanced example of nix-on-droid system config with home-manager.";
|
||||
};
|
||||
};
|
||||
}
|
||||
// flake-utils.lib.eachSystem [ "aarch64-linux" "i686-linux" "x86_64-darwin" "x86_64-linux" ] (system: {
|
||||
formatter = nixpkgs.legacyPackages.${system}.nixpkgs-fmt;
|
||||
|
|
|
|||
54
templates/advanced/flake.nix
Normal file
54
templates/advanced/flake.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
description = "Advanced example of nix-on-droid system config with home-manager.";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-22.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nix-on-droid = {
|
||||
url = "github:t184256/nix-on-droid/release-22.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.home-manager.follows = "home-manager";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, nix-on-droid }: {
|
||||
|
||||
nixOnDroidConfigurations.deviceName = nix-on-droid.lib.nixOnDroidConfiguration {
|
||||
system = "aarch64-linux";
|
||||
config = ./nix-on-droid.nix;
|
||||
|
||||
# list of extra modules for nix-on-droid system
|
||||
extraModules = [
|
||||
# { nix.registry.nixpkgs.flake = nixpkgs; }
|
||||
# ./path/to/module.nix
|
||||
|
||||
# or import source out-of-tree modules like:
|
||||
# flake.nixOnDroidModules.module
|
||||
];
|
||||
|
||||
# list of extra special args for nix-on-droid modules
|
||||
extraSpecialArgs = {
|
||||
# rootPath = ./.;
|
||||
};
|
||||
|
||||
# set nixpkgs instance, it is recommended to apply nix-on-droid.overlays.default
|
||||
pkgs = import nixpkgs {
|
||||
system = "aarch64-linux";
|
||||
|
||||
overlays = [
|
||||
nix-on-droid.overlays.default
|
||||
# add other overlays
|
||||
];
|
||||
};
|
||||
|
||||
# set path to home-manager flake
|
||||
home-manager-path = home-manager.outPath;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
8
templates/advanced/home.nix
Normal file
8
templates/advanced/home.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Read the changelog before changing this value
|
||||
home.stateVersion = "22.05";
|
||||
|
||||
# insert home-manager config
|
||||
}
|
||||
47
templates/advanced/nix-on-droid.nix
Normal file
47
templates/advanced/nix-on-droid.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Simply install just the packages
|
||||
environment.packages = with pkgs; [
|
||||
# User-facing stuff that you really really want to have
|
||||
vim # or some other editor, e.g. nano or neovim
|
||||
|
||||
# Some common stuff that people expect to have
|
||||
#diffutils
|
||||
#findutils
|
||||
#utillinux
|
||||
#tzdata
|
||||
#hostname
|
||||
#man
|
||||
#gnugrep
|
||||
#gnupg
|
||||
#gnused
|
||||
#gnutar
|
||||
#bzip2
|
||||
#gzip
|
||||
#xz
|
||||
#zip
|
||||
#unzip
|
||||
];
|
||||
|
||||
# Backup etc files instead of failing to activate generation if a file already exists in /etc
|
||||
environment.etcBackupExtension = ".bak";
|
||||
|
||||
# Read the changelog before changing this value
|
||||
system.stateVersion = "22.05";
|
||||
|
||||
# Set up nix for flakes
|
||||
nix.extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
|
||||
# Set your time zone
|
||||
#time.timeZone = "Europe/Berlin";
|
||||
|
||||
# Configure home-manager
|
||||
home-manager = {
|
||||
config = ./home.nix;
|
||||
backupFileExtension = "hm-bak";
|
||||
useGlobalPkgs = true;
|
||||
};
|
||||
}
|
||||
27
templates/home-manager/flake.nix
Normal file
27
templates/home-manager/flake.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
description = "Minimal example of nix-on-droid system config with home-manager.";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-22.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nix-on-droid = {
|
||||
url = "github:t184256/nix-on-droid/release-22.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.home-manager.follows = "home-manager";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, nix-on-droid }: {
|
||||
|
||||
nixOnDroidConfigurations.deviceName = nix-on-droid.lib.nixOnDroidConfiguration {
|
||||
system = "aarch64-linux";
|
||||
config = ./nix-on-droid.nix;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
55
templates/home-manager/nix-on-droid.nix
Normal file
55
templates/home-manager/nix-on-droid.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Simply install just the packages
|
||||
environment.packages = with pkgs; [
|
||||
# User-facing stuff that you really really want to have
|
||||
vim # or some other editor, e.g. nano or neovim
|
||||
|
||||
# Some common stuff that people expect to have
|
||||
#diffutils
|
||||
#findutils
|
||||
#utillinux
|
||||
#tzdata
|
||||
#hostname
|
||||
#man
|
||||
#gnugrep
|
||||
#gnupg
|
||||
#gnused
|
||||
#gnutar
|
||||
#bzip2
|
||||
#gzip
|
||||
#xz
|
||||
#zip
|
||||
#unzip
|
||||
];
|
||||
|
||||
# Backup etc files instead of failing to activate generation if a file already exists in /etc
|
||||
environment.etcBackupExtension = ".bak";
|
||||
|
||||
# Read the changelog before changing this value
|
||||
system.stateVersion = "22.05";
|
||||
|
||||
# Set up nix for flakes
|
||||
nix.extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
|
||||
# Set your time zone
|
||||
#time.timeZone = "Europe/Berlin";
|
||||
|
||||
# Configure home-manager
|
||||
home-manager = {
|
||||
backupFileExtension = "hm-bak";
|
||||
useGlobalPkgs = true;
|
||||
|
||||
config =
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
# Read the changelog before changing this value
|
||||
home.stateVersion = "22.05";
|
||||
|
||||
# insert home-manager config
|
||||
};
|
||||
};
|
||||
}
|
||||
21
templates/minimal/flake.nix
Normal file
21
templates/minimal/flake.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
description = "Basic example of nix-on-droid system config.";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
|
||||
|
||||
nix-on-droid = {
|
||||
url = "github:t184256/nix-on-droid/release-22.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, nix-on-droid }: {
|
||||
|
||||
nixOnDroidConfigurations.deviceName = nix-on-droid.lib.nixOnDroidConfiguration {
|
||||
system = "aarch64-linux";
|
||||
config = ./nix-on-droid.nix;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
40
templates/minimal/nix-on-droid.nix
Normal file
40
templates/minimal/nix-on-droid.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Simply install just the packages
|
||||
environment.packages = with pkgs; [
|
||||
# User-facing stuff that you really really want to have
|
||||
vim # or some other editor, e.g. nano or neovim
|
||||
|
||||
# Some common stuff that people expect to have
|
||||
#diffutils
|
||||
#findutils
|
||||
#utillinux
|
||||
#tzdata
|
||||
#hostname
|
||||
#man
|
||||
#gnugrep
|
||||
#gnupg
|
||||
#gnused
|
||||
#gnutar
|
||||
#bzip2
|
||||
#gzip
|
||||
#xz
|
||||
#zip
|
||||
#unzip
|
||||
];
|
||||
|
||||
# Backup etc files instead of failing to activate generation if a file already exists in /etc
|
||||
environment.etcBackupExtension = ".bak";
|
||||
|
||||
# Read the changelog before changing this value
|
||||
system.stateVersion = "22.05";
|
||||
|
||||
# Set up nix for flakes
|
||||
nix.extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
|
||||
# Set your time zone
|
||||
#time.timeZone = "Europe/Berlin";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue