mirror of
https://github.com/srid/nixos-config.git
synced 2026-05-11 17:36:07 +08:00
Use home-manager directly from flake.nix for non-NixOS (#10)
* wip * put in same flake.nix * use home.nix directly * home2 * finalize
This commit is contained in:
parent
bce719e79d
commit
e9b3e28af6
4 changed files with 98 additions and 46 deletions
10
Makefile
10
Makefile
|
|
@ -1,6 +1,14 @@
|
|||
all:
|
||||
sudo nixos-rebuild switch -j auto && systemctl restart --user emanote
|
||||
|
||||
|
||||
# Not sure why this doesn't reliably work
|
||||
homeBroken:
|
||||
nix build --no-link ".#homeConfigurations."`whoami`@`hostname`".activationPackage"
|
||||
./result/activate
|
||||
|
||||
# This requires the symlink to be setup; see README
|
||||
home:
|
||||
PATH="${HOME}/.nix-profile/bin/:${PATH}" home-manager switch
|
||||
|
||||
freeupboot:
|
||||
# Delete all but the last few generations
|
||||
|
|
|
|||
11
README.md
11
README.md
|
|
@ -5,6 +5,17 @@ This repository contains the Nix / NixOS configuration for all of my systems. St
|
|||
|
||||
VSCode note: <kbd>Ctrl+Shift+B</kbd> will run `sudo nixos-rebuild switch`.
|
||||
|
||||
## Non-NixOS
|
||||
|
||||
First time run,
|
||||
|
||||
```
|
||||
ln -s /path/to/here ~/.config/nixpkgs # Why? See Makefile
|
||||
make home
|
||||
```
|
||||
|
||||
Afterwards, feel free to use `home-manager switch`.
|
||||
|
||||
## Install notes
|
||||
|
||||
- Hetzner dedicated from Linux Rescue system: https://github.com/serokell/nixos-install-scripts/pull/1#pullrequestreview-746593205
|
||||
|
|
|
|||
79
flake.nix
79
flake.nix
|
|
@ -57,35 +57,56 @@
|
|||
{
|
||||
# The "name" in nixosConfigurations.${name} should match the `hostname`
|
||||
#
|
||||
nixosConfigurations.p71 = mkHomeMachine
|
||||
false
|
||||
./hosts/p71.nix
|
||||
[
|
||||
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-p53
|
||||
./features/desktopish
|
||||
#./features/gnome.nix
|
||||
./features/desktopish/guiapps.nix
|
||||
./features/server/devserver.nix
|
||||
./features/ema/emanote.nix
|
||||
#./features/virtualbox.nix
|
||||
./features/lxd.nix
|
||||
#./features/server-mode.nix
|
||||
# ./features/postgrest.nix
|
||||
./features/server/devserver.nix
|
||||
];
|
||||
nixosConfigurations.x1c7 = mkHomeMachine
|
||||
./hosts/x1c7.nix
|
||||
[
|
||||
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x1-7th-gen
|
||||
./features/distributed-build.nix
|
||||
./features/gnome.nix
|
||||
./features/desktopish/guiapps.nix
|
||||
];
|
||||
nixosConfigurations.facade = mkHomeMachine
|
||||
true
|
||||
./hosts/facade.nix
|
||||
[
|
||||
];
|
||||
nixosConfigurations = {
|
||||
p71 = mkHomeMachine
|
||||
false
|
||||
./hosts/p71.nix
|
||||
[
|
||||
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-p53
|
||||
./features/desktopish
|
||||
#./features/gnome.nix
|
||||
./features/desktopish/guiapps.nix
|
||||
./features/server/devserver.nix
|
||||
./features/ema/emanote.nix
|
||||
#./features/virtualbox.nix
|
||||
./features/lxd.nix
|
||||
#./features/server-mode.nix
|
||||
# ./features/postgrest.nix
|
||||
./features/server/devserver.nix
|
||||
];
|
||||
x1c7 = mkHomeMachine
|
||||
./hosts/x1c7.nix
|
||||
[
|
||||
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x1-7th-gen
|
||||
./features/distributed-build.nix
|
||||
./features/gnome.nix
|
||||
./features/desktopish/guiapps.nix
|
||||
];
|
||||
facade = mkHomeMachine
|
||||
true
|
||||
./hosts/facade.nix
|
||||
[
|
||||
];
|
||||
};
|
||||
|
||||
# non-NixOS systems
|
||||
homeConfigurations =
|
||||
let
|
||||
username = "srid";
|
||||
hostname = "P71";
|
||||
in
|
||||
{
|
||||
# WSL ubuntu
|
||||
"${username}@${hostname}" = home-manager.lib.homeManagerConfiguration {
|
||||
inherit username system;
|
||||
homeDirectory = "/home/${username}";
|
||||
configuration = import ./home.nix {
|
||||
inherit inputs system;
|
||||
bare = false;
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
44
home.nix
44
home.nix
|
|
@ -1,7 +1,6 @@
|
|||
# HACK: bare
|
||||
{ bare ? false, pkgs, inputs, system, ... }:
|
||||
let
|
||||
nix-thunk =
|
||||
(import (builtins.fetchTarball "https://github.com/obsidiansystems/nix-thunk/archive/master.tar.gz") { }).command;
|
||||
#himalayaSrc = inputs.himalaya;
|
||||
#himalaya = import ./features/email/himalaya.nix { inherit pkgs inputs system; };
|
||||
neovim-nightly = inputs.neovim-nightly-overlay.packages.${system}.neovim;
|
||||
|
|
@ -40,11 +39,6 @@ rec {
|
|||
|
||||
# latex
|
||||
# texlive.combined.scheme-full
|
||||
|
||||
git-remote-gcrypt
|
||||
|
||||
nodePackages.mermaid-cli
|
||||
asciidoctor
|
||||
];
|
||||
|
||||
programs = {
|
||||
|
|
@ -130,19 +124,37 @@ rec {
|
|||
bash = {
|
||||
enable = true;
|
||||
shellAliases = {
|
||||
g = "git";
|
||||
t = "tig";
|
||||
g = "${pkgs.git}/bin/git";
|
||||
t = "${pkgs.tig}/bin/tig";
|
||||
l = "${pkgs.exa}/bin/exa";
|
||||
ll = "${pkgs.exa}/bin/exa -l";
|
||||
ls = "l";
|
||||
#h = "himalaya";
|
||||
};
|
||||
sessionVariables = { };
|
||||
bashrcExtra = ''
|
||||
. ~/.nix-profile/etc/profile.d/nix.sh
|
||||
export PATH=$HOME/.nix-profile/bin:$PATH
|
||||
'';
|
||||
};
|
||||
|
||||
starship = {
|
||||
enable = true;
|
||||
};
|
||||
starship =
|
||||
{
|
||||
enable = true;
|
||||
settings = {
|
||||
username = {
|
||||
format = "[$user](bold blue) ";
|
||||
disabled = false;
|
||||
show_always = true;
|
||||
};
|
||||
hostname = {
|
||||
ssh_only = false;
|
||||
format = "on [$hostname](bold red) ";
|
||||
trim_at = ".companyname.com";
|
||||
disabled = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
bat.enable = true;
|
||||
autojump.enable = false;
|
||||
|
|
@ -154,9 +166,9 @@ rec {
|
|||
programs.ssh = {
|
||||
enable = true;
|
||||
matchBlocks = {
|
||||
"p71" = {
|
||||
hostname = "192.168.2.76";
|
||||
};
|
||||
#"p71" = {
|
||||
# hostname = "192.168.2.76";
|
||||
#};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -168,5 +180,5 @@ rec {
|
|||
# You can update Home Manager without changing this value. See
|
||||
# the Home Manager release notes for a list of state version
|
||||
# changes in each release.
|
||||
home.stateVersion = "21.03";
|
||||
# home.stateVersion = "21.03";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue