Minimal flake for darwin

This commit is contained in:
Cyryl Płotnicki 2022-03-10 12:21:27 +00:00
parent 65a70e5a80
commit 28c7af45d3
11 changed files with 133 additions and 24 deletions

45
INSTALL_MACOS.md Normal file
View File

@ -0,0 +1,45 @@
## Nix
sh <(curl -L https://nixos.org/nix/install)
Add
```
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
``` to `/etc/zshrc`
[restart]
## nix-darwin
nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
add
```
services.nix-daemon.enable = true;
nix = {
useDaemon = true;
gc.automatic = true;
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
``` to `~/.nixpkgs/darwin-configuration.nix
./result/bin/darwin-installer
darwin-rebuild switch
[restart]
add
```
experimental-features = nix-command flakes
``` to `/etc/nix/nix.conf`
## home-manager
nix build .#darwinConfigurations.macmini.system
darwin-rebuild build --flake '.

View File

@ -19,6 +19,27 @@
"type": "github"
}
},
"darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs-stable"
]
},
"locked": {
"lastModified": 1645293039,
"narHash": "sha256-PwdDu+SkX8dreeuJ/4av1sEluNZdrpdXv8JsRKKg1Yc=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "1df878b6f8351795a3bebfbe4fd2d02e1e8b29d6",
"type": "github"
},
"original": {
"owner": "lnl7",
"ref": "master",
"repo": "nix-darwin",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
@ -223,6 +244,7 @@
"root": {
"inputs": {
"agenix": "agenix",
"darwin": "darwin",
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"neuron": "neuron",

View File

@ -1,7 +1,8 @@
{
description = "NixOS configuration with flakes";
outputs = { self, flake-utils, home-manager, nixpkgs-nixos-unstable
, nixpkgs-stable, nixos-hardware, nur, agenix, neuron, sops }@inputs:
, nixpkgs-stable, darwin, nixos-hardware, nur, agenix, neuron, sops
}@inputs:
let
mkServer = pkgs: system: hostname:
@ -33,7 +34,7 @@
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.cyryl = {
imports = [ ./nixos/home-manager ];
imports = [ ./nixos/home-manager ./nixos/home-manager/linux.nix ];
_module.args.inputs = inputs;
};
}
@ -47,8 +48,23 @@
};
};
};
in {
darwinConfigurations."macmini" = darwin.lib.darwinSystem {
system = "x86_64-darwin";
modules = [
(./. + "/nixos/boxes/macmini")
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.cyryl = {
imports = [ ./nixos/home-manager ];
};
}
];
};
nixosConfigurations = {
foureighty = mkWorkstation nixpkgs-stable "x86_64-linux" "foureighty";
skinnyv = mkWorkstation nixpkgs-stable "x86_64-linux" "skinnyv";
@ -116,6 +132,11 @@
ref = "master";
};
darwin = {
url = "github:lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs-stable";
};
home-manager = {
type = "github";
owner = "nix-community";

View File

@ -0,0 +1,26 @@
{ config, pkgs, inputs, lib, nixpkgs-nixos-unstable-and-unfree, ... }: {
environment.systemPackages = with pkgs; [ vim nixfmt ];
imports = [
../../git
../../mercurial
];
services.nix-daemon.enable = true;
nix = {
useDaemon = true;
gc.automatic = true;
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
programs.zsh.enable = true; # default shell on catalina
system.stateVersion = 4;
home-manager.users.cyryl = { ... }: {
imports = [ ];
home.packages = [ ];
};
}

View File

@ -20,7 +20,6 @@
fstrim.enable = true;
clipmenu.enable = true;
lorri.enable = true;
keybase.enable = true;
avahi = {
enable = true;

View File

@ -17,7 +17,6 @@
curl
tmux
htop
atop
home-manager
pciutils
powertop

View File

@ -38,7 +38,6 @@ in
home.packages = with pkgs; with pkgs.gnome3; with pkgs.python38Packages; [
anarchism
apvlv
binwalk-full
brave
cheese
@ -55,7 +54,6 @@ in
gnome-screenshot
gsettings-desktop-schemas
inkscape
keybase-gui
libreoffice
mindforger
modem-manager-gui

View File

@ -2,14 +2,11 @@
{
home.packages = with pkgs; [
(pass.withExtensions (ext: [ ext.pass-otp ext.pass-import ext.pass-genphrase ext.pass-audit ext.pass-update ]))
apvlv
aria
atop
bfg-repo-cleaner
binutils
bitwarden-cli
bottom
btrfs-progs
curl
dnsutils
docker-compose
@ -25,9 +22,7 @@
imagemagick
jmtpfs
jq
keybase
kopia
lm_sensors
mercurial
minicom
nix-index
@ -35,7 +30,6 @@
nixfmt
nixpkgs-fmt
pciutils
powertop
ranger
restic
ripgrep-all
@ -45,6 +39,5 @@
unzip
wget
whois
wirelesstools
];
}

View File

@ -10,17 +10,8 @@
news.display = "show";
home.packages = with pkgs; [
nerdfonts
glibcLocales
];
services.gpg-agent = {
enable = true;
pinentryFlavor = "curses";
};
services.kbfs.enable = true;
imports = [
./programs/tmux.nix
./programs/zsh.nix

View File

@ -0,0 +1,16 @@
{ config, pkgs, inputs, ... }:
{
services.gpg-agent = {
enable = true;
pinentryFlavor = "curses";
};
home.packages = with pkgs; [
atop
btrfs-progs
glibcLocales
lm_sensors
nerdfonts
powertop
wirelesstools
];
}

View File

@ -55,7 +55,6 @@ in
};
home.packages = with pkgs; [
aria
atop
bfg-repo-cleaner
curl
dnsutils