Start moving to flakes

This commit is contained in:
Artemis Tosini 2021-11-20 04:08:18 +00:00
parent a9a23e3c26
commit f2cba2afef
Signed by: artemist
GPG key ID: ADFFE553DCBB831E
16 changed files with 222 additions and 55 deletions

12
.gitmodules vendored
View file

@ -1,12 +0,0 @@
[submodule "private"]
path = private
url = git@github.com:artemist/nixos-config-private
[submodule "externals/wip-pinebook-pro"]
path = externals/wip-pinebook-pro
url = https://github.com/samueldr/wip-pinebook-pro
[submodule "externals/home-manager"]
path = externals/home-manager
url = https://github.com/nix-community/home-manager
[submodule "externals/packages/rustybar"]
path = externals/packages/rustybar
url = https://github.com/mildlyfunctionalgays/rustybar

@ -1 +0,0 @@
Subproject commit 56da46578d8b41c8a3f8bb83eb3b6b194a6538bc

View file

@ -1,26 +1,27 @@
{ stdenv,
lib,
writeScriptBin,
runtimeShell,
yubikey-manager,
wofi,
wl-clipboard,
gawk,
gnugrep,
coreutils }:
{ stdenv
, lib
, writeScriptBin
, runtimeShell
, yubikey-manager
, wofi
, wl-clipboard
, gawk
, gnugrep
, coreutils
}:
writeScriptBin "ykclip-wofi" ''
#! ${runtimeShell}
PATH=${lib.makeBinPath [ yubikey-manager wofi wl-clipboard gawk gnugrep coreutils ]}
set -euo pipefail
#! ${runtimeShell}
PATH=${lib.makeBinPath [ yubikey-manager wofi wl-clipboard gawk gnugrep coreutils ]}
set -euo pipefail
ykman list --serials | grep $1 > /dev/null
ykman list --serials | grep $1 > /dev/null
name=$(ykman -d $1 oath accounts list | wofi -k /dev/null -i -d)
name=$(ykman -d $1 oath accounts list | wofi -k /dev/null -i -d)
line=$(ykman -d $1 oath accounts code "$name" | head -n 1)
if test -n "$line"
then
echo $line | awk '{print $NF}' | wl-copy
fi
line=$(ykman -d $1 oath accounts code "$name" | head -n 1)
if test -n "$line"
then
echo $line | awk '{print $NF}' | wl-copy
fi
''

@ -1 +0,0 @@
Subproject commit 7df87f4f3baecccba79807c291b3bbd62ac61e0f

119
flake.lock Normal file
View file

@ -0,0 +1,119 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1637362702,
"narHash": "sha256-WFGEXrh2wWHi5DLdUX1qM5T3P5TgmVE6AyM+bVuOaNs=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "8230decb3f0cb3408607accc93e5d0951ebf3963",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1637155076,
"narHash": "sha256-26ZPNiuzlsnXpt55Q44+yzXvp385aNAfevzVEKbrU5Q=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "715f63411952c86c8f57ab9e3e3cb866a015b5f2",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"private": {
"locked": {
"lastModified": 1637378493,
"narHash": "sha256-NLiiT8fGx4SY497Tcgq0R0l2RkBaqQ7pJgZRwjwxixc=",
"ref": "unified",
"rev": "07ecdbf1995278df6aa67b1055fd9f94f3971010",
"revCount": 27,
"type": "git",
"url": "ssh://git@github.com/artemist/nixos-config-private"
},
"original": {
"ref": "unified",
"type": "git",
"url": "ssh://git@github.com/artemist/nixos-config-private"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"private": "private",
"rustybar": "rustybar",
"wip-pinebook-pro": "wip-pinebook-pro"
}
},
"rustybar": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1637380210,
"narHash": "sha256-aUpCO7JeSlhG2ydZucnzHTQdCd849u1EzTgIqTjpJV4=",
"owner": "mildlyfunctionalgays",
"repo": "rustybar",
"rev": "c21016e81ad2b460e05d1049cd15aafeac6f5dc9",
"type": "github"
},
"original": {
"owner": "mildlyfunctionalgays",
"repo": "rustybar",
"type": "github"
}
},
"utils": {
"locked": {
"lastModified": 1637014545,
"narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"wip-pinebook-pro": {
"flake": false,
"locked": {
"lastModified": 1635815864,
"narHash": "sha256-oIhShK2j198APnhm45iqhF8TDQ3M50LY3Hxn4hUDPF4=",
"owner": "samueldr",
"repo": "wip-pinebook-pro",
"rev": "caa3d3e324c369454da05ef6558c44ee1a0ee234",
"type": "github"
},
"original": {
"owner": "samueldr",
"repo": "wip-pinebook-pro",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

72
flake.nix Normal file
View file

@ -0,0 +1,72 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
rustybar = {
url = "github:mildlyfunctionalgays/rustybar";
inputs.nixpkgs.follows = "nixpkgs";
};
private.url = "git+ssh://git@github.com/artemist/nixos-config-private?ref=unified";
wip-pinebook-pro = {
url = "github:samueldr/wip-pinebook-pro";
flake = false;
};
};
outputs = { self, nixpkgs, home-manager, rustybar, private, wip-pinebook-pro }:
let
defaultModules = [
({ pkgs, ... }: {
nixpkgs.overlays = [ rustybar.overlay ];
})
private.nixosModules.base
home-manager.nixosModules.home-manager
];
makeSystem = conf: nixpkgs.lib.nixosSystem (nixpkgs.lib.recursiveUpdate
{
specialArgs = {
inherit rustybar;
};
}
conf);
in
{
nixosConfigurations.starlight = makeSystem {
system = "x86_64-linux";
modules = defaultModules ++ [
./system/starlight
private.nixosModules.starlight
];
};
nixosConfigurations.rainbowdash = makeSystem {
system = "x86_64-linux";
modules = defaultModules ++ [
./system/rainbowdash
];
};
nixosConfigurations.spike = makeSystem {
system = "x86_64-linux";
modules = defaultModules ++ [
./system/spike
];
};
nixosConfigurations.mistmane = makeSystem {
system = "aarch64-linux";
modules = defaultModules ++ [
./system/mistmane
];
};
};
}

View file

@ -1,9 +1,6 @@
{ ... }:
{
imports = [
../externals/home-manager/nixos
];
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;

View file

@ -20,7 +20,6 @@
format.signOff = true;
init.defaultBranch = "canon";
log.showSignature = true;
mailmap.file = "${../private/mailmap}";
credential.helper = "!${pkgs.gitAndTools.pass-git-helper}/bin/pass-git-helper $@";
sendemail = {

View file

@ -1,6 +1,5 @@
{ pkgs, lib, config, ... }:
let
rustybar = pkgs.callPackage ../externals/packages/rustybar { };
sway-scripts = pkgs.callPackage ../externals/packages/sway-scripts { };
cfg = config.wayland.windowManager.sway;
mod = cfg.config.modifier;
@ -91,7 +90,7 @@ in
window.titlebar = true;
bars = [{
statusCommand = "${rustybar}/bin/rustybar";
statusCommand = "${pkgs.rustybar}/bin/rustybar";
position = "top";
fonts = cfg.config.fonts;
colors = {

@ -1 +0,0 @@
Subproject commit d7f24ba79b387aab96eea1066b8e3a431bb54aaa

View file

@ -1,14 +1,7 @@
{ config, pkgs, lib, ... }:
{
imports = [
./private
./system/current
];
nix = {
daemonNiceLevel = 5;
daemonIONiceLevel = 1;
autoOptimiseStore = true;
package = pkgs.nixFlakes;
extraOptions = ''

View file

@ -145,7 +145,7 @@ in
]) ++ (with pkgs.hunspellDicts; [
en-us-large
de_DE
]) ++ (lib.optionals (builtins.currentSystem == "x86_64-linux") (with pkgs; [
]) ++ (lib.optionals (pkgs.system == "x86_64-linux") (with pkgs; [
efibootmgr
efitools
sbsigntool

View file

@ -5,6 +5,7 @@
./sway.nix
./packages.nix
./pipewire.nix
./base.nix
../home
];
@ -27,7 +28,7 @@
hardware = {
bluetooth.enable = true;
opengl.driSupport32Bit = (builtins.currentSystem == "x86_64-linux");
opengl.driSupport32Bit = (pkgs.system == "x86_64-linux");
steam-hardware.enable = true;
};
}

View file

@ -4,7 +4,6 @@
imports = [
./boot-config.nix
./hardware-configuration.nix
../../externals/wip-pinebook-pro/pinebook_pro.nix
../../sets/laptop.nix
../../sets/workstation.nix
];

View file

@ -5,7 +5,8 @@
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "usbhid" ];
@ -14,12 +15,14 @@
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/8b204d52-62c1-48e9-b487-e7138f49903a";
{
device = "/dev/disk/by-uuid/8b204d52-62c1-48e9-b487-e7138f49903a";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/375e4660-be08-40ba-8961-0a9cc3a96187";
{
device = "/dev/disk/by-uuid/375e4660-be08-40ba-8961-0a9cc3a96187";
fsType = "ext4";
};

View file

@ -5,7 +5,6 @@
./boot-config.nix
./hardware-configuration.nix
./scripts.nix
../../private/starlight.nix
../../sets/builder.nix
../../sets/cpu/amd.nix
../../sets/fpga.nix