Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dotfiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jens Nolte
dotfiles
Commits
210e46e2
Commit
210e46e2
authored
3 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Move some flake inputs from machines repository here
parent
226bae05
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
bin/deploy
+10
-0
10 additions, 0 deletions
bin/deploy
configuration.nix
+5
-0
5 additions, 0 deletions
configuration.nix
flake.lock
+121
-0
121 additions, 0 deletions
flake.lock
flake.nix
+23
-12
23 additions, 12 deletions
flake.nix
machine-manager.nix
+13
-9
13 additions, 9 deletions
machine-manager.nix
with
172 additions
and
21 deletions
bin/deploy
+
10
−
0
View file @
210e46e2
...
...
@@ -94,6 +94,10 @@ else
fi
# Update nar-hash of dotfiles repository
nix flake lock
--update-input
dotfiles
"path:
$MACHINES_PATH
"
if
[[
"
$operation
"
=
"iso"
]]
then
print_info
"Building iso image"
...
...
@@ -109,6 +113,12 @@ readonly system_installable="path:$MACHINES_PATH#nixosConfigurations.$hostname.c
readonly
nixos_config_path
=
$(
nix path-info
$common_nix_flags
--json
"
$system_installable
"
| jq
--raw-output
".[0].path"
)
print
>
&2
"
$nixos_config_path
"
if
[[
-z
"
$nixos_config_path
"
]]
then
print_error
"No path was generated"
exit
3
fi
print_info
"Deploying target system configuration"
if
[[
"
$is_target_host
"
||
"
$operation
"
=
"build"
]]
...
...
This diff is collapsed.
Click to expand it.
configuration.nix
+
5
−
0
View file @
210e46e2
...
...
@@ -2,6 +2,7 @@
{
name
,
path
,
channel
,
isIso
,
extraLayersDir
,
flakeInputs
,
flakeOutputs
,
system
,
extraOverlays
}:
{
lib
,
config
,
pkgs
,
...
}:
let
installResult
=
builtins
.
fromJSON
(
builtins
.
readFile
(
path
+
"/install-result.json"
));
dotfilesConfig
=
import
(
path
+
"/dotfiles.nix"
);
...
...
@@ -68,6 +69,10 @@ in
# Make nixpkgs path available inside of the configuration
#_module.args.nixpkgsPath = channel;
# Let 'nixos-version --json' know about the Git revision
# of this flake.
system
.
configurationRevision
=
lib
.
mkIf
(
flakeInputs
.
self
?
rev
)
flakeInputs
.
self
.
rev
;
environment
.
shellAliases
=
{
# nixos-option won't run without a configuration. With an empty config it does not show configured values, but can at least be used to search options and show default values.
nixos-option
=
"nixos-option -I nixos-config=
${
pkgs
.
writeText
"empty-configuration.nix"
"{...}:{}"
}
"
;
...
...
This diff is collapsed.
Click to expand it.
flake.lock
0 → 100644
+
121
−
0
View file @
210e46e2
{
"nodes": {
"homemanager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1617220862,
"narHash": "sha256-nLka+S6Vww8hTF3ZkzK/BezvgAo1Z433/L6TR1SiXyM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "ad04237d5142f53dcba258942b78e2d2bbf210c8",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1617082367,
"narHash": "sha256-W0cQPGjc4IVzryaGycuoS8KZkXafS1P23w/fcKLoD5Y=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "04a2b269d8921505a2969fc9ec25c1f517f2b307",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"q": {
"inputs": {
"nixpkgs": [
"qd",
"nixpkgs"
],
"qd": [
"qd"
]
},
"locked": {
"host": "git.c3pb.de",
"lastModified": 1614196923,
"narHash": "sha256-Yjnd3hSW1XpZ9BQJCUeC0ES3KrWe6kubh22wkxEp9xE=",
"owner": "jens",
"repo": "q",
"rev": "1002c6c644bb377a22a8ac5a8ac9e54bcb055874",
"type": "gitlab"
},
"original": {
"host": "git.c3pb.de",
"owner": "jens",
"repo": "q",
"type": "gitlab"
}
},
"qauth": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"host": "git.c3pb.de",
"lastModified": 1611110209,
"narHash": "sha256-PGJWsILu0NO8ERv8+fgKFf6idkDuZgFlJGtGWdJsV8A=",
"owner": "jens",
"repo": "qauth",
"rev": "72d18c270a256434c18b1fadd68755413dd8fdb6",
"type": "gitlab"
},
"original": {
"host": "git.c3pb.de",
"owner": "jens",
"repo": "qauth",
"type": "gitlab"
}
},
"qd": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"host": "git.c3pb.de",
"lastModified": 1615431166,
"narHash": "sha256-ZwR9s18dGMrPJ+SLFOTL2BCsd4eZ6dd86v+Z7M2LSZc=",
"owner": "jens",
"repo": "qd",
"rev": "49571704277e7f59712622dc2c87ee18b226da31",
"type": "gitlab"
},
"original": {
"host": "git.c3pb.de",
"owner": "jens",
"repo": "qd",
"type": "gitlab"
}
},
"root": {
"inputs": {
"homemanager": "homemanager",
"nixpkgs": "nixpkgs",
"q": "q",
"qauth": "qauth",
"qd": "qd"
}
}
},
"root": "root",
"version": 7
}
This diff is collapsed.
Click to expand it.
flake.nix
+
23
−
12
View file @
210e46e2
{
inputs
=
{
nixpkgs
.
url
=
github
:
nixos/nixpkgs/nixos-unstable
;
#homemanager = {
# url = github:nix-community/home-manager;
# inputs.nixpkgs.follows = "nixpkgs";
#};
#qauth = {
# url = gitlab:jens/qauth?host=git.c3pb.de;
# inputs.nixpkgs.follows = "nixpkgs";
#};
homemanager
=
{
url
=
github
:
nix-community/home-manager
;
inputs
.
nixpkgs
.
follows
=
"nixpkgs"
;
};
qauth
=
{
url
=
gitlab
:
jens/qauth
?
host
=
git
.
c3pb
.
de
;
inputs
.
nixpkgs
.
follows
=
"nixpkgs"
;
};
qd
=
{
url
=
gitlab
:
jens/qd
?
host
=
git
.
c3pb
.
de
;
inputs
.
nixpkgs
.
follows
=
"nixpkgs"
;
};
q
=
{
url
=
gitlab
:
jens/q
?
host
=
git
.
c3pb
.
de
;
inputs
.
qd
.
follows
=
"qd"
;
inputs
.
nixpkgs
.
follows
=
"qd/nixpkgs"
;
};
};
outputs
=
{
...
}:
{
overlay
=
import
./pkgs
;
nixosModules
=
{
greetd
=
import
./modules/greetd.nix
;
outputs
=
inputs_
@
{
self
,
nixpkgs
,
...
}:
{
machine-manager
=
(
import
./machine-manager.nix
)
{
flakeInputs
=
inputs_
;
flakeOutputs
=
self
;
};
overlay
=
import
./pkgs
;
};
}
This diff is collapsed.
Click to expand it.
machine-manager.nix
+
13
−
9
View file @
210e46e2
#
entry point for machine configurations:
# (import <repo-path> { machinesDir=./machines }).<netname>.configurations.<hostname>
{
f
lakeInputs
,
f
lakeOutputs
,
machinesDir
,
extraLayersDir
,
extraOverlays
?
[]
}:
#
applied by this repositories flake
{
flakeInputs
,
flakeOutputs
}:
# applied by outer flake
{
extraF
lakeInputs
,
extraF
lakeOutputs
,
machinesDir
,
extraLayersDir
,
extraOverlays
?
[]
}:
with
builtins
;
with
flakeInputs
.
nixpkgs
.
lib
;
let
finalFlakeInputs
=
flakeInputs
//
extraFlakeInputs
;
finalFlakeOutputs
=
flakeOutputs
//
extraFlakeOutputs
;
# defaultChannel :: path (channel)
#defaultChannel = loadChannel "nixos-unstable";
...
...
@@ -19,7 +21,7 @@ let
# allChannels :: { *: path (channel) }
#allChannels = with helpers; keysToAttrs loadChannel (readFilterDir (filterAnd [(not filterDirHidden) filterDirDirs]) channelsDir);
# getMachineChannel :: string -> path
getMachineChannel
=
_
:
flakeInputs
.
nixpkgs
;
getMachineChannel
=
_
:
f
inalF
lakeInputs
.
nixpkgs
;
#getMachineChannel = { name, path }:
# let
# channelFile = path + "/channel.nix";
...
...
@@ -36,17 +38,19 @@ let
evaluateConfig
=
pkgs
:
args
:
(
import
"
${
pkgs
}
/nixos/lib/eval-config.nix"
args
)
.
config
;
mkNixosSystemDerivations
=
{
name
,
path
}:
let
channel
=
flakeInputs
.
nixpkgs
;
channel
=
f
inalF
lakeInputs
.
nixpkgs
;
system
=
"x86_64-linux"
;
mkMachineConfig
=
{
name
,
path
,
isIso
}:
{
imports
=
[
(
import
./configuration.nix
{
inherit
name
path
isIso
extraLayersDir
flakeInputs
flakeOutputs
system
extraOverlays
;
inherit
name
path
isIso
extraLayersDir
system
extraOverlays
;
flakeInputs
=
finalFlakeInputs
;
flakeOutputs
=
finalFlakeOutputs
;
channel
=
machineChannels
.
${
name
};
})
];
_module
.
args
.
flakeInputs
=
flakeInputs
;
_module
.
args
.
flakeOutputs
=
flakeOutputs
;
_module
.
args
.
flakeInputs
=
f
inalF
lakeInputs
;
_module
.
args
.
flakeOutputs
=
f
inalF
lakeOutputs
;
_module
.
args
.
system
=
system
;
};
configuration
=
mkMachineConfig
{
inherit
name
path
;
isIso
=
false
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment