Test nix shell / develop

This commit is contained in:
iFargle 2023-09-19 17:39:24 +09:00
parent ccaf84c18b
commit de9d6cb70f
6 changed files with 22 additions and 8 deletions

View file

@ -15,10 +15,13 @@
![Gruv'd Hyprland](./screenshot.png "Hyprland with a Gruvboxy theme") ![Gruv'd Hyprland](./screenshot.png "Hyprland with a Gruvboxy theme")
--- ---
# To Do List # To Do List
* [ ] Look into `nix develop` - [Link](https://zero-to-nix.com/concepts/nix#unified-cli)
* [ ] Build a better dashboard to monitor all my nixified devices
* [ ] Look into Remote Builds - [Link](https://nixos.org/manual/nix/stable/advanced-topics/distributed-builds.html) * [ ] Look into Remote Builds - [Link](https://nixos.org/manual/nix/stable/advanced-topics/distributed-builds.html)
* [ ] Find a way to remove all default search engines in Firefox (Google, Amazon, etc) * [ ] Find a way to remove all default search engines in Firefox (Google, Amazon, etc)
* [ ] Figure out what the home-manager `account` options are for. * [ ] Figure out what the home-manager `account` options are for.
* [ ] Security hardening * [ ] Security hardening
* [ ] Edit the hosts file
* [ ] cronjob * [ ] cronjob
* [ ] Change wallpaper at a certain time of day * [ ] Change wallpaper at a certain time of day
* [ ] emacs * [ ] emacs
@ -32,7 +35,7 @@
Completed ToDo List [here](complete.md) Completed ToDo List [here](complete.md)
--- ---
# Directory structure # Directory Structure
``` ```
. .
├── home-manager ├── home-manager

View file

@ -11,8 +11,6 @@
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
doom-emacs.url = "github:nix-community/nix-doom-emacs"; doom-emacs.url = "github:nix-community/nix-doom-emacs";
nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nixos-generators.url = "github:/nix-community/nixos-generators";
nixos-generators.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = { self, nixpkgs, nixpkgs-wayland, home-manager, lanzaboote, nur, sops-nix, doom-emacs, ... } @inputs: outputs = { self, nixpkgs, nixpkgs-wayland, home-manager, lanzaboote, nur, sops-nix, doom-emacs, ... } @inputs:
let let
@ -45,4 +43,10 @@
nixos-rpi4-img = libx.mkImage { hostname = "nixos-rpi4-img"; platform = "aarch64-linux"; format = "sd-aarch64"; }; nixos-rpi4-img = libx.mkImage { hostname = "nixos-rpi4-img"; platform = "aarch64-linux"; format = "sd-aarch64"; };
}; };
}; };
# Devshell for bootstrapping; acessible via 'nix develop' or 'nix-shell' (legacy)
devShells = libx.forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./shell.nix { inherit pkgs; }
);
} }

View file

@ -44,12 +44,10 @@
}; };
bashrcExtra = '' bashrcExtra = ''
sops-edit() { sops-edit() {
nix-shell
nix-shell -p sops --run "sops $1" nix-shell -p sops --run "sops $1"
} }
sops-update() { sops-update() {
nix-shell
nix-shell -p sops --run "sops updatekeys $1" nix-shell -p sops --run "sops updatekeys $1"
} }

View file

@ -49,5 +49,5 @@
boot.kernel.sysctl = { "net.ipv4.ip_forward" = true; }; boot.kernel.sysctl = { "net.ipv4.ip_forward" = true; };
# Temporary # Temporary
networking.firewall.allowedTCPPorts = [ 22 ]; # networking.firewall.allowedTCPPorts = [ 22 ];
} }

View file

@ -49,5 +49,5 @@
boot.kernel.sysctl = { "net.ipv4.ip_forward" = true; }; boot.kernel.sysctl = { "net.ipv4.ip_forward" = true; };
# Temporary # Temporary
networking.firewall.allowedTCPPorts = [ 22 ]; # networking.firewall.allowedTCPPorts = [ 22 ];
} }

View file

@ -4,14 +4,23 @@ let
sops-nix = builtins.fetchTarball { sops-nix = builtins.fetchTarball {
url = "https://github.com/Mic92/sops-nix/archive/master.tar.gz"; url = "https://github.com/Mic92/sops-nix/archive/master.tar.gz";
}; };
lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked;
in in
mkShell { mkShell {
import (fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz";
sha256 = lock.narHash;
})
NIX_CONFIG = "experimental-features = nix-command flakes";
# imports all files ending in .asc/.gpg # imports all files ending in .asc/.gpg
sopsPGPKeyDirs = [ sopsPGPKeyDirs = [
"${toString ./.}/keys/hosts" "${toString ./.}/keys/hosts"
"${toString ./.}/keys/users" "${toString ./.}/keys/users"
]; ];
nativeBuildInputs = [ nativeBuildInputs = [
pkgs.nix
pkgs.home-manager
pkgs.git
(pkgs.callPackage sops-nix {}).sops-import-keys-hook (pkgs.callPackage sops-nix {}).sops-import-keys-hook
]; ];
} }