feat(nix): Functional system-manager
This commit is contained in:
parent
21429963ef
commit
0e80eb3083
8 changed files with 69 additions and 103 deletions
|
@ -39,6 +39,14 @@ darwin-rebuild switch --flake .
|
|||
|
||||
Nix in non-NixOS Linux is handled by [system-manager](https://github.com/numtide/system-manager).
|
||||
|
||||
#### Rebuild
|
||||
|
||||
Unfortunately, root access is required in order to use system-manager.
|
||||
|
||||
```sh
|
||||
sudo -i nix run 'github:numtide/system-manager' --extra-experimental-features "nix-command flakes" -- switch --flake $PWD
|
||||
```
|
||||
|
||||
### Home
|
||||
|
||||
This is for per-user setup. Instead of managing the entire system, you're
|
||||
|
|
|
@ -15,8 +15,7 @@
|
|||
}
|
||||
);
|
||||
|
||||
# FIXME: Not yet functional
|
||||
systemConfigs = (
|
||||
systemConfigs = ( # sudo is required, sadly
|
||||
import ./systems/nix {
|
||||
inherit (nixpkgs) lib;
|
||||
inherit inputs nixpkgs system-manager home-manager vars;
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
let
|
||||
custom = {
|
||||
python = (pkgs.python312Full.withPackages (py: [
|
||||
py.pip
|
||||
py.tkinter
|
||||
py.dnspython
|
||||
]));
|
||||
};
|
||||
in {
|
||||
inherit custom;
|
||||
packages = [
|
||||
pkgs.zsh
|
||||
pkgs.home-manager
|
||||
|
|
|
@ -8,13 +8,6 @@
|
|||
# NOTE: List packages installed in system profile. To search by name, run:
|
||||
# `nix-env -qaP | grep wget`
|
||||
environment.systemPackages =
|
||||
let
|
||||
python = (pkgs.python312Full.withPackages (py: [
|
||||
py.pip
|
||||
py.tkinter
|
||||
py.dnspython
|
||||
]));
|
||||
in
|
||||
common.packages ++ [
|
||||
pkgs.git
|
||||
pkgs.vim
|
||||
|
@ -23,9 +16,9 @@
|
|||
pkgs.passExtensions.pass-otp
|
||||
pkgs.gnupg
|
||||
pkgs.htop-vim
|
||||
python
|
||||
(pkgs.inkscape.override { python3 = python; })
|
||||
#(pkgs.poetry.override { python3 = python; })
|
||||
common.custom.python
|
||||
(pkgs.inkscape.override { python3 = common.custom.python; })
|
||||
#(pkgs.poetry.override { python3 = common.custom.python; })
|
||||
pkgs.fastfetch
|
||||
pkgs.eza
|
||||
pkgs.lf
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
{ pkgs, config, vars, common, ... }:
|
||||
|
||||
{
|
||||
# NOTE: List packages installed in system profile. To search by name, run:
|
||||
# `nix-env -qaP | grep wget`
|
||||
environment.systemPackages =
|
||||
let
|
||||
python = (pkgs.python312Full.withPackages (py: [
|
||||
py.pip
|
||||
py.tkinter
|
||||
py.dnspython
|
||||
]));
|
||||
in
|
||||
common.packages ++ [
|
||||
pkgs.zsh
|
||||
pkgs.git
|
||||
pkgs.vim
|
||||
pkgs.neovim
|
||||
pkgs.pass
|
||||
pkgs.passExtensions.pass-otp
|
||||
pkgs.gnupg
|
||||
pkgs.htop-vim
|
||||
python
|
||||
(pkgs.inkscape.override { python3 = python; })
|
||||
#(pkgs.poetry.override { python3 = python; })
|
||||
pkgs.fastfetch
|
||||
pkgs.eza
|
||||
pkgs.lf
|
||||
pkgs.wimlib
|
||||
pkgs.google-cloud-sdk
|
||||
pkgs.nmap
|
||||
pkgs.cargo
|
||||
pkgs.android-tools
|
||||
pkgs.coreutils-full
|
||||
pkgs.rclone
|
||||
(pkgs.yt-dlp.override { withAlias = true; })
|
||||
pkgs.zoxide
|
||||
];
|
||||
|
||||
# Auto upgrade nix package and the daemon service.
|
||||
services.nix-daemon.enable = true;
|
||||
#nix.package = pkgs.nix;
|
||||
|
||||
# Necessary for using flakes on this system.
|
||||
nix.settings.experimental-features = "nix-command flakes";
|
||||
|
||||
# Create /etc/zshrc that loads the nix-darwin environment.
|
||||
programs.zsh.enable = true; # default shell on catalina
|
||||
#programs.fish.enable = true;
|
||||
|
||||
# Set Git commit hash for darwin-version.
|
||||
system.configurationRevision = vars.rev or null;
|
||||
|
||||
# Used for backwards compatibility, please read the changelog before changing.
|
||||
# $ darwin-rebuild changelog
|
||||
system = {
|
||||
stateVersion = 4;
|
||||
};
|
||||
}
|
|
@ -11,10 +11,9 @@ in
|
|||
common = (mkCommon pkgs);
|
||||
in
|
||||
system-manager.lib.makeSystemConfig {
|
||||
inherit system;
|
||||
specialArgs = { inherit inputs pkgs vars common; };
|
||||
extraSpecialArgs = { inherit inputs pkgs vars common; };
|
||||
modules = [
|
||||
./configuration.nix
|
||||
./potato
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
16
.config/nix/systems/nix/potato/default.nix
Normal file
16
.config/nix/systems/nix/potato/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ pkgs, config, vars, common, ... }:
|
||||
|
||||
{
|
||||
config = {
|
||||
system-manager.allowAnyDistro = true;
|
||||
|
||||
# NOTE: List packages installed in system profile. To search by name, run:
|
||||
# `nix-env -qaP | grep wget`
|
||||
environment.systemPackages =
|
||||
common.packages ++ [
|
||||
pkgs.zoxide
|
||||
];
|
||||
|
||||
nixpkgs.hostPlatform = pkgs.system;
|
||||
};
|
||||
}
|
|
@ -78,12 +78,13 @@ fi
|
|||
|
||||
# -- Path
|
||||
export BUN_INSTALL="$HOME/.bun"
|
||||
if [ $ZI_IS_DARWIN ]; then
|
||||
if [ $ZI_IS_DARWIN = 1 ]; then
|
||||
export PYTHONPATH="$HOME/Library/Python/3.10/lib:$PYTHONPATH"
|
||||
LOCAL_PATH=$(du -d1 "$ZI_BINARY_HOME" | cut -f2 > /tmp/ENV_PATH && paste -sd ':' /tmp/ENV_PATH)
|
||||
LOCAL_PATH="/run/current-system/sw/bin:/usr/local/bin:$HOME/.rd/bin:$HOME/Library/Python/3.10/bin:$LOCAL_PATH"
|
||||
else
|
||||
LOCAL_PATH=$(du "$ZI_BINARY_HOME" -d 1 | cut -f2 | paste -sd ':')
|
||||
LOCAL_PATH="/run/system-manager/sw/bin:$LOCAL_PATH"
|
||||
fi
|
||||
PATH="$BUN_INSTALL/bin:$HOME/.pub-cache/bin:$HOME/.local/share/go/bin:$ANDROID_AVD_HOME:$HOME/.local/share/npm/bin:$HOME/.local/share/cargo/bin:$ZI_SCRIPTS_HOME/bin:$LOCAL_PATH${PATH:+:${PATH}}"
|
||||
# export RUST_SRC_PATH=$(rustc --print sysroot)/lib/rustlib/src/rust/library
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue